History

tipc: tipc: rename address types in user api

The three address type structs in the user API have names that in reality reflect the specific, non-Linux environment where they were originally created. We now give them more intuitive names, in accordance with how TIPC is described in the current documentation. struct tipc_portid -> struct tipc_socket_addr struct tipc_name -> struct tipc_service_addr struct tipc_name_seq -> struct tipc_service_range To avoid confusion, we also update some commmets and macro names to match the new terminology. For compatibility, we add macros that map all old names to the new ones.

Jon Maloy committed 8 years ago

Commit 7a74d391 parent 37922ea1 file · +33 −24Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/tipc.h+33−24
@@ -45,33 +45,33 @@ · 44 unmodified lines
45 * TIPC addressing primitives45 * TIPC addressing primitives
46 */46 */
47 47
48struct tipc_portid {48struct tipc_socket_addr {
49 __u32 ref;49 __u32 ref;
50 __u32 node;50 __u32 node;
51};51};
52 52
53struct tipc_name {53struct tipc_service_addr {
54 __u32 type;54 __u32 type;
55 __u32 instance;55 __u32 instance;
56};56};
57 57
58struct tipc_name_seq {58struct tipc_service_range {
59 __u32 type;59 __u32 type;
60 __u32 lower;60 __u32 lower;
61 __u32 upper;61 __u32 upper;
62};62};
63 63
64/*64/*
65 * Application-accessible port name types65 * Application-accessible service types
66 */66 */
67 67
68#define TIPC_CFG_SRV 0 /* configuration service name type */68#define TIPC_NODE_STATE 0 /* node state service type */
69#define TIPC_TOP_SRV 1 /* topology service name type */69#define TIPC_TOP_SRV 1 /* topology server service type */
70#define TIPC_LINK_STATE 2 /* link state name type */70#define TIPC_LINK_STATE 2 /* link state service type */
71#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */71#define TIPC_RESERVED_TYPES 64 /* lowest user-allowed service type */
72 72
73/*73/*
74 * Publication scopes when binding port names and port name sequences74 * Publication scopes when binding service / service range
75 */75 */
76enum tipc_scope {76enum tipc_scope {
77 TIPC_CLUSTER_SCOPE = 2, /* 0 can also be used */77 TIPC_CLUSTER_SCOPE = 2, /* 0 can also be used */
@@ -108,28 +108,28 @@ enum tipc_scope { · 30 unmodified lines
108 * TIPC topology subscription service definitions108 * TIPC topology subscription service definitions
109 */109 */
110 110
111#define TIPC_SUB_PORTS 0x01 /* filter for port availability */111#define TIPC_SUB_PORTS 0x01 /* filter: evt at each match */
112#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */112#define TIPC_SUB_SERVICE 0x02 /* filter: evt at first up/last down */
113#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */113#define TIPC_SUB_CANCEL 0x04 /* filter: cancel a subscription */
114 114
115#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */115#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
116 116
117struct tipc_subscr {117struct tipc_subscr {
118 struct tipc_name_seq seq; /* name sequence of interest */118 struct tipc_service_range seq; /* range of interest */
119 __u32 timeout; /* subscription duration (in ms) */119 __u32 timeout; /* subscription duration (in ms) */
120 __u32 filter; /* bitmask of filter options */120 __u32 filter; /* bitmask of filter options */
121 char usr_handle[8]; /* available for subscriber use */121 char usr_handle[8]; /* available for subscriber use */
122};122};
123 123
124#define TIPC_PUBLISHED 1 /* publication event */124#define TIPC_PUBLISHED 1 /* publication event */
125#define TIPC_WITHDRAWN 2 /* withdraw event */125#define TIPC_WITHDRAWN 2 /* withdrawal event */
126#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */126#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
127 127
128struct tipc_event {128struct tipc_event {
129 __u32 event; /* event type */129 __u32 event; /* event type */
130 __u32 found_lower; /* matching name seq instances */130 __u32 found_lower; /* matching range */
131 __u32 found_upper; /* " " " " */131 __u32 found_upper; /* " " */
132 struct tipc_portid port; /* associated port */132 struct tipc_socket_addr port; /* associated socket */
133 struct tipc_subscr s; /* associated subscription */133 struct tipc_subscr s; /* associated subscription */
134};134};
135 135
@@ -149,20 +149,20 @@ struct tipc_event { · 13 unmodified lines
149#define SOL_TIPC 271149#define SOL_TIPC 271
150#endif150#endif
151 151
152#define TIPC_ADDR_NAMESEQ 1152#define TIPC_ADDR_MCAST 1
153#define TIPC_ADDR_MCAST 1153#define TIPC_SERVICE_RANGE 1
154#define TIPC_ADDR_NAME 2154#define TIPC_SERVICE_ADDR 2
155#define TIPC_ADDR_ID 3155#define TIPC_SOCKET_ADDR 3
156 156
157struct sockaddr_tipc {157struct sockaddr_tipc {
158 unsigned short family;158 unsigned short family;
159 unsigned char addrtype;159 unsigned char addrtype;
160 signed char scope;160 signed char scope;
161 union {161 union {
162 struct tipc_portid id;162 struct tipc_socket_addr id;
163 struct tipc_name_seq nameseq;163 struct tipc_service_range nameseq;
164 struct {164 struct {
165 struct tipc_name name;165 struct tipc_service_addr name;
166 __u32 domain;166 __u32 domain;
167 } name;167 } name;
168 } addr;168 } addr;
@@ -230,8 +230,13 @@ struct tipc_sioc_ln_req { · 61 unmodified lines
230/* The macros and functions below are deprecated:230/* The macros and functions below are deprecated:
231 */231 */
232 232
233#define TIPC_CFG_SRV 0
233#define TIPC_ZONE_SCOPE 1234#define TIPC_ZONE_SCOPE 1
234 235
236#define TIPC_ADDR_NAMESEQ 1
237#define TIPC_ADDR_NAME 2
238#define TIPC_ADDR_ID 3
239
235#define TIPC_NODE_BITS 12240#define TIPC_NODE_BITS 12
236#define TIPC_CLUSTER_BITS 12241#define TIPC_CLUSTER_BITS 12
237#define TIPC_ZONE_BITS 8242#define TIPC_ZONE_BITS 8
@@ -250,6 +255,10 @@ struct tipc_sioc_ln_req { · 12 unmodified lines
250 255
251#define TIPC_ZONE_CLUSTER_MASK (TIPC_ZONE_MASK | TIPC_CLUSTER_MASK)256#define TIPC_ZONE_CLUSTER_MASK (TIPC_ZONE_MASK | TIPC_CLUSTER_MASK)
252 257
258#define tipc_portid tipc_socket_addr
259#define tipc_name tipc_service_addr
260#define tipc_name_seq tipc_service_range
261
253static inline __u32 tipc_addr(unsigned int zone,262static inline __u32 tipc_addr(unsigned int zone,
254 unsigned int cluster,263 unsigned int cluster,
255 unsigned int node)264 unsigned int node)