diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2011-10-07 13:37:34 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-12-27 11:33:27 -0500 |
commit | 4d163a326fa4868cce1bb75dd95855d40e5497c6 (patch) | |
tree | 7c126c2875c638bd85c7edc083c3f014a57b6a42 /net/tipc/bearer.h | |
parent | c61b666e260d5cc2e0203b21c689321e6ab0d676 (diff) |
tipc: Add new address conversion routines for Ethernet media
Enhances TIPC's Ethernet media support to provide 3 new address conversion
routines, which allow TIPC to interpret an address that is in string form
and to convert an address to and from the 20 byte format used in TIPC's
neighbor discovery messages.
These routines are pre-requisites to a follow on commit that hides all
media-specific addressing details from TIPC's generic bearer code.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/bearer.h')
-rw-r--r-- | net/tipc/bearer.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 4e9367f956a4..41a61d219c38 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -43,6 +43,17 @@ | |||
43 | #define MAX_MEDIA 2 | 43 | #define MAX_MEDIA 2 |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * Identifiers associated with TIPC message header media address info | ||
47 | * | ||
48 | * - address info field is 20 bytes long | ||
49 | * - media type identifier located at offset 3 | ||
50 | * - remaining bytes vary according to media type | ||
51 | */ | ||
52 | |||
53 | #define TIPC_MEDIA_ADDR_SIZE 20 | ||
54 | #define TIPC_MEDIA_TYPE_OFFSET 3 | ||
55 | |||
56 | /* | ||
46 | * Identifiers of supported TIPC media types | 57 | * Identifiers of supported TIPC media types |
47 | */ | 58 | */ |
48 | #define TIPC_MEDIA_TYPE_ETH 1 | 59 | #define TIPC_MEDIA_TYPE_ETH 1 |
@@ -68,7 +79,10 @@ struct tipc_bearer; | |||
68 | * @send_msg: routine which handles buffer transmission | 79 | * @send_msg: routine which handles buffer transmission |
69 | * @enable_bearer: routine which enables a bearer | 80 | * @enable_bearer: routine which enables a bearer |
70 | * @disable_bearer: routine which disables a bearer | 81 | * @disable_bearer: routine which disables a bearer |
71 | * @addr2str: routine which converts bearer's address to string form | 82 | * @addr2str: routine which converts media address to string |
83 | * @str2addr: routine which converts media address from string | ||
84 | * @addr2msg: routine which converts media address to protocol message area | ||
85 | * @msg2addr: routine which converts media address from protocol message area | ||
72 | * @bcast_addr: media address used in broadcasting | 86 | * @bcast_addr: media address used in broadcasting |
73 | * @priority: default link (and bearer) priority | 87 | * @priority: default link (and bearer) priority |
74 | * @tolerance: default time (in ms) before declaring link failure | 88 | * @tolerance: default time (in ms) before declaring link failure |
@@ -84,6 +98,9 @@ struct media { | |||
84 | int (*enable_bearer)(struct tipc_bearer *b_ptr); | 98 | int (*enable_bearer)(struct tipc_bearer *b_ptr); |
85 | void (*disable_bearer)(struct tipc_bearer *b_ptr); | 99 | void (*disable_bearer)(struct tipc_bearer *b_ptr); |
86 | int (*addr2str)(struct tipc_media_addr *a, char *str_buf, int str_size); | 100 | int (*addr2str)(struct tipc_media_addr *a, char *str_buf, int str_size); |
101 | int (*str2addr)(struct tipc_media_addr *a, char *str_buf); | ||
102 | int (*addr2msg)(struct tipc_media_addr *a, char *msg_area); | ||
103 | int (*msg2addr)(struct tipc_media_addr *a, char *msg_area); | ||
87 | struct tipc_media_addr bcast_addr; | 104 | struct tipc_media_addr bcast_addr; |
88 | u32 priority; | 105 | u32 priority; |
89 | u32 tolerance; | 106 | u32 tolerance; |