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.
Showing the changes to include/uapi/linux (2 of 5 files). Show all
Unified · Split
| @@ -38,6 +38,7 @@ · 37 unmodified lines | |||
| 38 | #define _LINUX_TIPC_H_ | 38 | #define _LINUX_TIPC_H_ |
| 39 | 39 | ||
| 40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
| 41 | #include <linux/sockios.h> | ||
| 41 | 42 | ||
| 42 | /* | 43 | /* |
| 43 | * TIPC addressing primitives | 44 | * TIPC addressing primitives |
| @@ -207,4 +208,25 @@ struct sockaddr_tipc { · 163 unmodified lines | |||
| 207 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ | 208 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ |
| 208 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ | 209 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ |
| 209 | 210 | ||
| 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 | }; | ||
| 210 | #endif | 232 | #endif |
| @@ -39,6 +39,7 @@ · 38 unmodified lines | |||
| 39 | 39 | ||
| 40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
| 41 | #include <linux/string.h> | 41 | #include <linux/string.h> |
| 42 | #include <linux/tipc.h> | ||
| 42 | #include <asm/byteorder.h> | 43 | #include <asm/byteorder.h> |
| 43 | 44 | ||
| 44 | #ifndef __KERNEL__ | 45 | #ifndef __KERNEL__ |
| @@ -154,15 +155,6 @@ · 109 unmodified lines | |||
| 154 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ | 155 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ |
| 155 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ | 156 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ |
| 156 | 157 | ||
| 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 | |||
| 166 | /* | 158 | /* |
| 167 | * Link priority limits (min, default, max, media default) | 159 | * Link priority limits (min, default, max, media default) |
| 168 | */ | 160 | */ |