diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-09 13:47:42 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-24 10:03:40 -0500 |
| commit | 70ce34ae66184d4b456f45e6544c5fc0c350f2e5 (patch) | |
| tree | f70a9c99c048b7445648e47b40f0955c865ea4d4 /pimd/pim_msg.h | |
| parent | 09778298e231208c5862c62ca0096c9f0101e446 (diff) | |
pimd: Add 'struct pim_msg_header' packed data structure.
Add the 'struct pim_msg_header' and convert
all places that encoded/decoded the message header
to use it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_msg.h')
| -rw-r--r-- | pimd/pim_msg.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pimd/pim_msg.h b/pimd/pim_msg.h index 5229f85c72..04a6a01e5c 100644 --- a/pimd/pim_msg.h +++ b/pimd/pim_msg.h @@ -35,6 +35,16 @@ */ #define PIM_MSG_ADDRESS_FAMILY_IPV4 (1) +/* + * Network Order pim_msg_hdr + */ +struct pim_msg_header { + uint8_t type:4; + uint8_t ver:4; + uint8_t reserved; + uint16_t checksum; +} __attribute__ ((packed)); + void pim_msg_build_header(uint8_t *pim_msg, int pim_msg_size, uint8_t pim_msg_type); uint8_t *pim_msg_addr_encode_ipv4_ucast(uint8_t *buf, |
