diff options
| author | Donald Sharp <sharpd@cumulusnetwroks.com> | 2016-07-16 04:49:32 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:02 -0500 |
| commit | 7643f0a1c651b84ff26a661cd6b7de806fe7fb3c (patch) | |
| tree | c6933a1fa80bb6cdc431edc8b02c45c55a4e876e /pimd/pim_pim.h | |
| parent | 36d9e7dcea547443ef25e5a8d308691f50099568 (diff) | |
pimd: Refactor pim message type to an enum
Change the pim message type to an enum and add the ability
to output a string based upon message type.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_pim.h')
| -rw-r--r-- | pimd/pim_pim.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/pimd/pim_pim.h b/pimd/pim_pim.h index 4b378fb2c3..e3559a2d97 100644 --- a/pimd/pim_pim.h +++ b/pimd/pim_pim.h @@ -40,15 +40,17 @@ #define PIM_DEFAULT_CAN_DISABLE_JOIN_SUPPRESSION (0) /* boolean */ #define PIM_DEFAULT_T_PERIODIC (60) /* RFC 4601: 4.11. Timer Values */ -#define PIM_MSG_TYPE_HELLO (0) -#define PIM_MSG_TYPE_REGISTER (1) -#define PIM_MSG_TYPE_REG_STOP (2) -#define PIM_MSG_TYPE_JOIN_PRUNE (3) -#define PIM_MSG_TYPE_BOOTSTRAP (4) -#define PIM_MSG_TYPE_ASSERT (5) -#define PIM_MSG_TYPE_GRAFT (6) -#define PIM_MSG_TYPE_GRAFT_ACK (7) -#define PIM_MSG_TYPE_CANDIDATE (8) +enum pim_msg_type { + PIM_MSG_TYPE_HELLO = 0, + PIM_MSG_TYPE_REGISTER, + PIM_MSG_TYPE_REG_STOP, + PIM_MSG_TYPE_JOIN_PRUNE, + PIM_MSG_TYPE_BOOTSTRAP, + PIM_MSG_TYPE_ASSERT, + PIM_MSG_TYPE_GRAFT, + PIM_MSG_TYPE_GRAFT_ACK, + PIM_MSG_TYPE_CANDIDATE +}; #define PIM_MSG_HDR_OFFSET_VERSION(pim_msg) (pim_msg) #define PIM_MSG_HDR_OFFSET_TYPE(pim_msg) (pim_msg) |
