diff options
| author | David S. Miller <davem@davemloft.net> | 2014-04-26 12:13:30 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-04-26 12:13:30 -0400 |
| commit | 7f51531c11be9f6ebace405aec724ffac043a8f5 (patch) | |
| tree | 0520313d3d6afcc42d7aaf27fbe699e8bc71e2d5 /include | |
| parent | d42f157b3498a042d9930506d4b55ded5dcb35c0 (diff) | |
| parent | 78acb1f9b898e85fa2c1e28e700b54b66b288e8d (diff) | |
Merge branch 'tipc-next'
Erik Hugne says:
====================
tipc: add support for link state subscriptions
Low level topology information like TIPC link up/down is useful for
applications like teamd to make smarter failover decisions in a
HA cluster environment. Fetching logical link names through an ioctl
may hurt the eyes of some. Suggestions for a more elegant way of doing
this would be appreciated in that case. :)
v2:
-Properly based on net-next
-Off-list comments from Billie Alsup:
-Add a string length parameter to tipc_node_get_linkname
-Use TIPC_MAX_LINK_NAME definition instead of hardcoded
value in tipc_sioc_ln_req linkname
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/uapi/linux/tipc.h | 23 | ||||
| -rw-r--r-- | include/uapi/linux/tipc_config.h | 10 |
2 files changed, 24 insertions, 9 deletions
diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h index 852373d27dbb..6f71b9b41595 100644 --- a/include/uapi/linux/tipc.h +++ b/include/uapi/linux/tipc.h | |||
| @@ -38,6 +38,7 @@ | |||
| 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 |
| @@ -87,6 +88,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
| 87 | 88 | ||
| 88 | #define TIPC_CFG_SRV 0 /* configuration service name type */ | 89 | #define TIPC_CFG_SRV 0 /* configuration service name type */ |
| 89 | #define TIPC_TOP_SRV 1 /* topology service name type */ | 90 | #define TIPC_TOP_SRV 1 /* topology service name type */ |
| 91 | #define TIPC_LINK_STATE 2 /* link state name type */ | ||
| 90 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ | 92 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ |
| 91 | 93 | ||
| 92 | /* | 94 | /* |
| @@ -206,4 +208,25 @@ struct sockaddr_tipc { | |||
| 206 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ | 208 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ |
| 207 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ | 209 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ |
| 208 | 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 | }; | ||
| 209 | #endif | 232 | #endif |
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h index 6b0bff09b3a7..41a76acbb305 100644 --- a/include/uapi/linux/tipc_config.h +++ b/include/uapi/linux/tipc_config.h | |||
| @@ -39,6 +39,7 @@ | |||
| 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__ |
| @@ -155,15 +156,6 @@ | |||
| 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 | /* |
| 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 | /* | ||
| 167 | * Link priority limits (min, default, max, media default) | 159 | * Link priority limits (min, default, max, media default) |
| 168 | */ | 160 | */ |
| 169 | 161 | ||
