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
4545 * TIPC addressing primitives
4646 */
4747
48−struct tipc_portid {
48+struct tipc_socket_addr {
4949 __u32 ref;
5050 __u32 node;
5151 };
5252
53−struct tipc_name {
53+struct tipc_service_addr {
5454 __u32 type;
5555 __u32 instance;
5656 };
5757
58−struct tipc_name_seq {
58+struct tipc_service_range {
5959 __u32 type;
6060 __u32 lower;
6161 __u32 upper;
6262 };
6363
6464 /*
65− * Application-accessible port name types
65+ * Application-accessible service types
6666 */
6767
68−#define TIPC_CFG_SRV 0 /* configuration service name type */
69−#define TIPC_TOP_SRV 1 /* topology service name type */
70−#define TIPC_LINK_STATE 2 /* link state name type */
71−#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
68+#define TIPC_NODE_STATE 0 /* node state service type */
69+#define TIPC_TOP_SRV 1 /* topology server service type */
70+#define TIPC_LINK_STATE 2 /* link state service type */
71+#define TIPC_RESERVED_TYPES 64 /* lowest user-allowed service type */
7272
7373 /*
74− * Publication scopes when binding port names and port name sequences
74+ * Publication scopes when binding service / service range
7575 */
7676 enum tipc_scope {
7777 TIPC_CLUSTER_SCOPE = 2, /* 0 can also be used */
@@ -108,28 +108,28 @@ enum tipc_scope { · 30 unmodified lines
108108 * TIPC topology subscription service definitions
109109 */
110110
111−#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
112−#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
113−#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
111+#define TIPC_SUB_PORTS 0x01 /* filter: evt at each match */
112+#define TIPC_SUB_SERVICE 0x02 /* filter: evt at first up/last down */
113+#define TIPC_SUB_CANCEL 0x04 /* filter: cancel a subscription */
114114
115115 #define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
116116
117117 struct tipc_subscr {
118− struct tipc_name_seq seq; /* name sequence of interest */
118+ struct tipc_service_range seq; /* range of interest */
119119 __u32 timeout; /* subscription duration (in ms) */
120120 __u32 filter; /* bitmask of filter options */
121121 char usr_handle[8]; /* available for subscriber use */
122122 };
123123
124124 #define TIPC_PUBLISHED 1 /* publication event */
125−#define TIPC_WITHDRAWN 2 /* withdraw event */
125+#define TIPC_WITHDRAWN 2 /* withdrawal event */
126126 #define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
127127
128128 struct tipc_event {
129129 __u32 event; /* event type */
130− __u32 found_lower; /* matching name seq instances */
131− __u32 found_upper; /* " " " " */
132− struct tipc_portid port; /* associated port */
130+ __u32 found_lower; /* matching range */
131+ __u32 found_upper; /* " " */
132+ struct tipc_socket_addr port; /* associated socket */
133133 struct tipc_subscr s; /* associated subscription */
134134 };
135135
@@ -149,20 +149,20 @@ struct tipc_event { · 13 unmodified lines
149149 #define SOL_TIPC 271
150150 #endif
151151
152−#define TIPC_ADDR_NAMESEQ 1
153−#define TIPC_ADDR_MCAST 1
154−#define TIPC_ADDR_NAME 2
155−#define TIPC_ADDR_ID 3
152+#define TIPC_ADDR_MCAST 1
153+#define TIPC_SERVICE_RANGE 1
154+#define TIPC_SERVICE_ADDR 2
155+#define TIPC_SOCKET_ADDR 3
156156
157157 struct sockaddr_tipc {
158158 unsigned short family;
159159 unsigned char addrtype;
160160 signed char scope;
161161 union {
162− struct tipc_portid id;
163− struct tipc_name_seq nameseq;
162+ struct tipc_socket_addr id;
163+ struct tipc_service_range nameseq;
164164 struct {
165− struct tipc_name name;
165+ struct tipc_service_addr name;
166166 __u32 domain;
167167 } name;
168168 } addr;
@@ -230,8 +230,13 @@ struct tipc_sioc_ln_req { · 61 unmodified lines
230230 /* The macros and functions below are deprecated:
231231 */
232232
233+#define TIPC_CFG_SRV 0
233234 #define TIPC_ZONE_SCOPE 1
234235
236+#define TIPC_ADDR_NAMESEQ 1
237+#define TIPC_ADDR_NAME 2
238+#define TIPC_ADDR_ID 3
239+
235240 #define TIPC_NODE_BITS 12
236241 #define TIPC_CLUSTER_BITS 12
237242 #define TIPC_ZONE_BITS 8
@@ -250,6 +255,10 @@ struct tipc_sioc_ln_req { · 12 unmodified lines
250255
251256 #define TIPC_ZONE_CLUSTER_MASK (TIPC_ZONE_MASK | TIPC_CLUSTER_MASK)
252257
258+#define tipc_portid tipc_socket_addr
259+#define tipc_name tipc_service_addr
260+#define tipc_name_seq tipc_service_range
261+
253262 static inline __u32 tipc_addr(unsigned int zone,
254263 unsigned int cluster,
255264 unsigned int node)