History

tipc: add ioctl to fetch link names

We add a new ioctl for AF_TIPC that can be used to fetch the logical name for a link to a remote node on a given bearer. This should be used in combination with link state subscriptions. The logical name size limit definitions are moved to tipc.h, as they are now also needed by the new ioctl.

Erik Hugne committed 12 years ago

Commit 78acb1f1 parent a89778d5 files · +77 −12Browse files

Showing the changes to include/uapi/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/tipc.h +22 −0
  2. include/uapi/linux/tipc_config.h +1 −9
include/uapi/linux/tipc.h+22−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #define _LINUX_TIPC_H_
3939
4040 #include <linux/types.h>
41+#include <linux/sockios.h>
4142
4243 /*
4344 * TIPC addressing primitives
@@ -207,4 +208,25 @@ struct sockaddr_tipc { · 163 unmodified lines
207208 #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
208209 #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */
209210
211+/*
212+ * Maximum sizes of TIPC bearer-related names (including terminating NULL)
213+ * The string formatting for each name element is:
214+ * media: media
215+ * interface: media:interface name
216+ * link: Z.C.N:interface-Z.C.N:interface
217+ *
218+ */
219+
220+#define TIPC_MAX_MEDIA_NAME 16
221+#define TIPC_MAX_IF_NAME 16
222+#define TIPC_MAX_BEARER_NAME 32
223+#define TIPC_MAX_LINK_NAME 60
224+
225+#define SIOCGETLINKNAME SIOCPROTOPRIVATE
226+
227+struct tipc_sioc_ln_req {
228+ __u32 peer;
229+ __u32 bearer_id;
230+ char linkname[TIPC_MAX_LINK_NAME];
231+};
210232 #endif
include/uapi/linux/tipc_config.h+1−9
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939
4040 #include <linux/types.h>
4141 #include <linux/string.h>
42+#include <linux/tipc.h>
4243 #include <asm/byteorder.h>
4344
4445 #ifndef __KERNEL__
@@ -154,15 +155,6 @@ · 109 unmodified lines
154155 #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
155156 #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
156157
157−/*
158− * Maximum sizes of TIPC bearer-related names (including terminating NUL)
159− */
160−
161−#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
162−#define TIPC_MAX_IF_NAME 16 /* format = interface */
163−#define TIPC_MAX_BEARER_NAME 32 /* format = media:interface */
164−#define TIPC_MAX_LINK_NAME 60 /* format = Z.C.N:interface-Z.C.N:interface */
165−
166158 /*
167159 * Link priority limits (min, default, max, media default)
168160 */