summaryrefslogtreecommitdiff
path: root/pimd/pim_msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_msg.h')
-rw-r--r--pimd/pim_msg.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/pimd/pim_msg.h b/pimd/pim_msg.h
index ad9b5d9c01..5f50303967 100644
--- a/pimd/pim_msg.h
+++ b/pimd/pim_msg.h
@@ -23,6 +23,8 @@
#include <netinet/in.h>
#include "pim_jp_agg.h"
+
+#define PIM_HDR_LEN sizeof(struct pim_msg_header)
/*
Number Description
---------- ------------------
@@ -41,11 +43,20 @@ enum pim_msg_address_family {
/*
* Network Order pim_msg_hdr
+ * =========================
+ * PIM Header definition as per RFC 5059. N bit introduced to indicate
+ * do-not-forward option in PIM Boot strap Message.
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |PIM Ver| Type |N| Reserved | Checksum |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct pim_msg_header {
uint8_t type : 4;
uint8_t ver : 4;
- uint8_t reserved;
+ uint8_t Nbit : 1; /* No Fwd Bit */
+ uint8_t reserved : 7;
uint16_t checksum;
} __attribute__((packed));
@@ -58,7 +69,9 @@ struct pim_encoded_ipv4_unicast {
struct pim_encoded_group_ipv4 {
uint8_t ne;
uint8_t family;
- uint8_t reserved;
+ uint8_t bidir : 1; /* Bidir bit */
+ uint8_t reserved : 6; /* Reserved */
+ uint8_t sz : 1; /* scope zone bit */
uint8_t mask;
struct in_addr addr;
} __attribute__((packed));
@@ -88,7 +101,7 @@ struct pim_jp {
} __attribute__((packed));
void pim_msg_build_header(uint8_t *pim_msg, size_t pim_msg_size,
- uint8_t pim_msg_type);
+ 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);