]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_const.h
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / eigrpd / eigrp_const.h
index 8133587579f13d96610076001187ca187f9e015e..3a103fb9f2e5d2559ba67c4cb0b13541fac02239 100644 (file)
@@ -32,8 +32,6 @@
 #ifndef _ZEBRA_EIGRP_CONST_H_
 #define _ZEBRA_EIGRP_CONST_H_
 
-#define FALSE 0
-
 #define EIGRP_NEIGHBOR_DOWN           0
 #define EIGRP_NEIGHBOR_PENDING        1
 #define EIGRP_NEIGHBOR_UP             2
@@ -48,7 +46,6 @@
 #define EIGRP_VARIANCE_DEFAULT  1
 #define EIGRP_MAX_PATHS_DEFAULT 4
 
-
 /* Return values of functions involved in packet verification */
 #define MSG_OK    0
 #define MSG_NG    1
 #define EIGRP_AUTH_MD5_TLV_SIZE          40
 #define EIGRP_AUTH_SHA256_TLV_SIZE          56
 
-/*Cisco routers use only first 44 bytes of basic hello for their MD5 calculations*/
+/*Cisco routers use only first 44 bytes of basic hello for their MD5
+ * calculations*/
 #define EIGRP_MD5_BASIC_COMPUTE       44
 #define EIGRP_MD5_UPDATE_INIT_COMPUTE       40
 
-
-
 #define EIGRP_AUTH_BASIC_HELLO_FLAG       0x01
 #define EIGRP_AUTH_TID_HELLO_FLAG       0x02
 #define EIGRP_AUTH_UPDATE_INIT_FLAG       0x04
@@ -96,6 +92,7 @@
 #define EIGRP_MULTICAST_ADDRESS            0xe000000A /*224.0.0.10*/
 
 #define EIGRP_MAX_METRIC                   0xffffffffU    /*4294967295*/
+enum metric_change { METRIC_DECREASE, METRIC_SAME, METRIC_INCREASE };
 
 #define DEFAULT_ROUTE               ZEBRA_ROUTE_MAX
 #define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE)
 #define EIGRP_HELLO_ADD_SEQUENCE              0x02
 #define EIGRP_HELLO_GRACEFUL_SHUTDOWN_NBR     0x04
 
-    /* EIGRP Network Type. */
- #define EIGRP_IFTYPE_NONE                0
- #define EIGRP_IFTYPE_POINTOPOINT         1
- #define EIGRP_IFTYPE_BROADCAST           2
- #define EIGRP_IFTYPE_NBMA                3
- #define EIGRP_IFTYPE_POINTOMULTIPOINT    4
- #define EIGRP_IFTYPE_LOOPBACK            5
- #define EIGRP_IFTYPE_MAX                 6
+/* EIGRP Network Type. */
+#define EIGRP_IFTYPE_NONE 0
+#define EIGRP_IFTYPE_POINTOPOINT 1
+#define EIGRP_IFTYPE_BROADCAST 2
+#define EIGRP_IFTYPE_NBMA 3
+#define EIGRP_IFTYPE_POINTOMULTIPOINT 4
+#define EIGRP_IFTYPE_LOOPBACK 5
+#define EIGRP_IFTYPE_MAX 6
 
 #define EIGRP_IF_ACTIVE                  0
 #define EIGRP_IF_PASSIVE                 1
 #define EIGRP_TOPOLOGY_TYPE_REMOTE_EXTERNAL     2 // Remote external network
 
 /*EIGRP TT entry flags*/
-#define EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG     (1 << 0)
-#define EIGRP_NEIGHBOR_ENTRY_FSUCCESSOR_FLAG    (1 << 1)
-#define EIGRP_NEIGHBOR_ENTRY_INTABLE_FLAG       (1 << 2)
-#define EIGRP_NEIGHBOR_ENTRY_EXTERNAL_FLAG      (1 << 3)
+#define EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG     (1 << 0)
+#define EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG    (1 << 1)
+#define EIGRP_NEXTHOP_ENTRY_INTABLE_FLAG       (1 << 2)
+#define EIGRP_NEXTHOP_ENTRY_EXTERNAL_FLAG      (1 << 3)
 
 /*EIGRP FSM state count, event count*/
 #define EIGRP_FSM_STATE_MAX                  5
 
 /*EEGRP FSM states*/
 enum eigrp_fsm_states {
-  EIGRP_FSM_STATE_PASSIVE,
-  EIGRP_FSM_STATE_ACTIVE_0,
-  EIGRP_FSM_STATE_ACTIVE_1,
-  EIGRP_FSM_STATE_ACTIVE_2,
-  EIGRP_FSM_STATE_ACTIVE_3,
+       EIGRP_FSM_STATE_PASSIVE,
+       EIGRP_FSM_STATE_ACTIVE_0,
+       EIGRP_FSM_STATE_ACTIVE_1,
+       EIGRP_FSM_STATE_ACTIVE_2,
+       EIGRP_FSM_STATE_ACTIVE_3,
 };
 
 /*EIGRP FSM events return values*/
@@ -150,14 +147,37 @@ enum eigrp_fsm_states {
 #define EIGRP_FSM_NEED_QUERY                           2
 
 /*EIGRP FSM events*/
-#define EIGRP_FSM_EVENT_NQ_FCN                  0 /*input event other than query from succ, FC not satisfied*/
-#define EIGRP_FSM_EVENT_LR                      1 /*last reply, FD is reset*/
-#define EIGRP_FSM_EVENT_Q_FCN                   2 /*query from succ, FC not satisfied*/
-#define EIGRP_FSM_EVENT_LR_FCS                  3 /*last reply, FC satisfied with current value of FDij*/
-#define EIGRP_FSM_EVENT_DINC                    4 /*distance increase while in active state*/
-#define EIGRP_FSM_EVENT_QACT                    5 /*query from succ while in active state*/
-#define EIGRP_FSM_EVENT_LR_FCN                  6 /*last reply, FC not satisfied with current value of FDij*/
-#define EIGRP_FSM_KEEP_STATE                    7 /*state not changed, usually by receiving not last reply */
+enum eigrp_fsm_events {
+       /*
+        * Input event other than query from succ,
+        * FC is not satisfied
+        */
+       EIGRP_FSM_EVENT_NQ_FCN,
+
+       /* last reply, FD is reset */
+       EIGRP_FSM_EVENT_LR,
+
+       /* Query from succ, FC not satisfied */
+       EIGRP_FSM_EVENT_Q_FCN,
+
+       /* last reply, FC satisifed with current value of FDij */
+       EIGRP_FSM_EVENT_LR_FCS,
+
+       /* distance increase while in a active state */
+       EIGRP_FSM_EVENT_DINC,
+
+       /* Query from succ while in active state */
+       EIGRP_FSM_EVENT_QACT,
+
+       /* last reply, FC not satisfied */
+       EIGRP_FSM_EVENT_LR_FCN,
+
+       /*
+        * state not changed
+        * usually by receiving not last reply
+        */
+       EIGRP_FSM_KEEP_STATE,
+};
 
 /**
  * External routes originate from some other protocol - these are them
@@ -175,7 +195,7 @@ enum eigrp_fsm_states {
 #define IDRP_PROTID            10              /*!< InterDomain Routing Protocol */
 #define CONN_PROTID            11              /*!< Connected source */
 
-/* 
+/*
  * metric k-value defaults
  */
 #define EIGRP_K1_DEFAULT       1               //!< unweighed inverse bandwidth
@@ -185,14 +205,12 @@ enum eigrp_fsm_states {
 #define EIGRP_K5_DEFAULT       0               //!< no reliability term
 #define EIGRP_K6_DEFAULT       0               //!< do not add in extended metrics
 
-
 /*
  * EIGRP Fixed header
  */
 #define EIGRP_HEADER_LEN        20U
 #define EIGRP_PACKET_MAX_LEN    65535U   /* includes IP Header size. */
 
-
 #define EIGRP_TLV_HDR_LENGTH    4
 
 /**
@@ -255,7 +273,8 @@ enum eigrp_fsm_states {
 #define EIGRP_TLV_PEER_TERMINATION_LEN         (9U)
 #define EIGRP_TLV_PEER_TIDLIST          (EIGRP_TLV_GENERAL | 0x0008)    /*!< peer sub-topology list */
 
-/* Older cisco routers send TIDLIST value wrong, adding for backwards compatabily */
+/* Older cisco routers send TIDLIST value wrong, adding for backwards
+ * compatabily */
 #define EIGRP_TLV_PEER_MTRLIST          (EIGRP_TLV_GENERAL | 0x00f5)
 
 /**
@@ -272,6 +291,12 @@ enum eigrp_fsm_states {
 #define EIGRP_TLV_IPv4_EXT              (EIGRP_TLV_IPv4 | EIGRP_TLV_EXTERNAL)
 #define EIGRP_TLV_IPv4_COM              (EIGRP_TLV_IPv4 | EIGRP_TLV_COMMUNITY)
 
+#define EIGRP_TLV_IPV4_SIZE_GRT_24_BIT      0x001D
+#define EIGRP_TLV_IPV4_SIZE_GRT_16_BIT      0x001C
+#define EIGRP_TLV_IPV4_SIZE_GRT_8_BIT       0x001B
+#define EIGRP_TLV_IPV4_SIZE_GRT_0_BIT       0x001A
+#define EIGRP_TLV_MAX_IPV4_BYTE             EIGRP_TLV_IPV4_SIZE_GRT_24_BIT
+
 /* max number of TLV IPv4 prefixes in packet */
 #define EIGRP_TLV_MAX_IPv4                             25
 
@@ -414,7 +439,6 @@ enum eigrp_fsm_states {
 #define EIGRP_EXTCOMM_RPM               0x8805 /* EIGRP Remote: Protocol + Metric    */
 #define EIGRP_EXTCOMM_VRR               0x8806 /* EIGRP Vecmet: Rsvd + (internal) Routerid */
 
-
 /*
  * EIGRP Filter constants
  */