Motr  M0
xcode.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2019-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
29 #pragma once
30 
31 #ifndef __MOTR_NET_SOCK_XCODE_H__
32 #define __MOTR_NET_SOCK_XCODE_H__
33 
34 #include "xcode/xcode_attr.h"
35 
36 #ifndef __KERNEL__
37 #include <sys/types.h>
38 #include <netinet/in.h> /* INET_ADDRSTRLEN */
39 #include <netinet/ip.h>
40 #include <arpa/inet.h> /* inet_pton, htons */
41 #else
42 #include <linux/in.h>
43 #include <linux/in6.h>
44 #endif
45 
46 #include "lib/assert.h"
47 #include "lib/types.h"
48 #include "lib/cookie.h"
49 #include "format/format.h"
50 #include "xcode/xcode_attr.h"
51 
52 #include "lib/cookie_xc.h"
53 #include "format/format_xc.h"
54 
61 enum {
62  WADDR_LEN = sizeof(struct in6_addr)
63 };
64 
65 M0_BASSERT(sizeof(struct in_addr) <= sizeof(struct in6_addr));
66 
68 struct addrdata {
71 
73 struct addr {
74  uint32_t a_family;
75  uint32_t a_socktype;
76  uint32_t a_protocol;
77  uint32_t a_port;
78  struct addrdata a_data;
79 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
80 
89 struct bdesc {
90  struct addr bd_addr;
92 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
93 
95 struct packet {
99  struct bdesc p_src;
101  struct bdesc p_dst;
103  uint32_t p_idx;
108  uint32_t p_nr;
117 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
118 
120 #endif /* __MOTR_NET_SOCK_XCODE_H__ */
121 
122 /*
123  * Local variables:
124  * c-indentation-style: "K&R"
125  * c-basic-offset: 8
126  * tab-width: 8
127  * fill-column: 80
128  * scroll-step: 1
129  * End:
130  */
131 /*
132  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
133  */
m0_bcount_t p_size
Definition: xcode.h:110
char v_data[WADDR_LEN]
Definition: xcode.h:69
uint32_t a_socktype
Definition: xcode.h:75
Definition: xcode.h:68
struct addrdata M0_XCA_DOMAIN(rpc)
uint64_t m0_bindex_t
Definition: types.h:80
uint64_t m0_bcount_t
Definition: types.h:77
struct m0_cookie bd_cookie
Definition: xcode.h:91
struct m0_format_header p_header
Definition: xcode.h:97
m0_bindex_t p_offset
Definition: xcode.h:112
uint32_t p_idx
Definition: xcode.h:103
m0_bcount_t p_totalsize
Definition: xcode.h:114
struct addr bd_addr
Definition: xcode.h:90
struct bdesc p_src
Definition: xcode.h:99
Definition: xcode.h:89
Definition: xcode.h:95
struct bdesc p_dst
Definition: xcode.h:101
struct m0_format_footer p_footer
Definition: xcode.h:116
uint32_t p_nr
Definition: xcode.h:108
Definition: xcode.h:73
uint32_t a_family
Definition: xcode.h:74
uint32_t a_port
Definition: xcode.h:77
uint32_t a_protocol
Definition: xcode.h:76
M0_BASSERT(sizeof(struct in_addr)<=sizeof(struct in6_addr))
struct inlinearray M0_XCA_ARRAY
struct addrdata a_data
Definition: xcode.h:78