diff options
Diffstat (limited to 'pimd/pim_msg.h')
| -rw-r--r-- | pimd/pim_msg.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pimd/pim_msg.h b/pimd/pim_msg.h index 456c356d9f..733210af3a 100644 --- a/pimd/pim_msg.h +++ b/pimd/pim_msg.h @@ -161,10 +161,18 @@ struct pim_encoded_source_ipv6 { typedef struct pim_encoded_ipv4_unicast pim_encoded_unicast; typedef struct pim_encoded_group_ipv4 pim_encoded_group; typedef struct pim_encoded_source_ipv4 pim_encoded_source; +typedef struct ip ipv_hdr; +#define IPV_SRC(ip_hdr) ((ip_hdr))->ip_src +#define IPV_DST(ip_hdr) ((ip_hdr))->ip_dst +#define IPV_LEN(ip_hdr) ((ip_hdr))->ip_len #else typedef struct pim_encoded_ipv6_unicast pim_encoded_unicast; typedef struct pim_encoded_group_ipv6 pim_encoded_group; typedef struct pim_encoded_source_ipv6 pim_encoded_source; +typedef struct ip6_hdr ipv_hdr; +#define IPV_SRC(ip_hdr) ((ip_hdr))->ip6_src +#define IPV_DST(ip_hdr) ((ip_hdr))->ip6_dst +#define IPV_LEN(ip_hdr) ((ip_hdr))->ip6_plen #endif /* clang-format on */ @@ -208,8 +216,9 @@ static inline pim_sgaddr pim_sgaddr_from_iphdr(const void *iphdr) } #endif -void pim_msg_build_header(uint8_t *pim_msg, size_t pim_msg_size, - uint8_t pim_msg_type, bool no_fwd); +void pim_msg_build_header(pim_addr src, pim_addr dst, uint8_t *pim_msg, + size_t pim_msg_size, uint8_t pim_msg_type, + bool no_fwd); uint8_t *pim_msg_addr_encode_ipv4_ucast(uint8_t *buf, struct in_addr addr); uint8_t *pim_msg_addr_encode_ipv4_group(uint8_t *buf, struct in_addr addr); |
