]> git.proxmox.com Git - mirror_frr.git/commitdiff
OSPFD: Set Segment Routing patch conform to C99
authorOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 23 Jan 2018 11:19:50 +0000 (12:19 +0100)
committerOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 23 Jan 2018 11:19:50 +0000 (12:19 +0100)
 - Change all u_intXX_t typedef to standard type uintXX_t
 - Correct removal of ZEBRA_OSPF_SR route in ospf_sr.c line 670

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
ospfd/ospf_ext.c
ospfd/ospf_ext.h
ospfd/ospf_ri.c
ospfd/ospf_ri.h
ospfd/ospf_sr.c
ospfd/ospf_sr.h

index 0ed5800438db5d376a63aeaf688b9482c551b49a..f56bca6b7bc170d1ad59bfe0d03f0d565f109af7 100644 (file)
@@ -205,9 +205,9 @@ static void del_ext_info(void *val)
 }
 
 /* Increment instance value for Extended Prefix Opaque LSAs Opaque ID field */
-static u_int32_t get_ext_pref_instance_value(void)
+static uint32_t get_ext_pref_instance_value(void)
 {
-       static u_int32_t seqno = 0;
+       static uint32_t seqno = 0;
 
        if (seqno < MAX_LEGAL_EXT_INSTANCE_NUM)
                seqno += 1;
@@ -218,9 +218,9 @@ static u_int32_t get_ext_pref_instance_value(void)
 }
 
 /* Increment instance value for Extended Link Opaque LSAs Opaque ID field */
-static u_int32_t get_ext_link_instance_value(void)
+static uint32_t get_ext_link_instance_value(void)
 {
-       static u_int32_t seqno = 0;
+       static uint32_t seqno = 0;
 
        if (seqno < MAX_LEGAL_EXT_INSTANCE_NUM)
                seqno += 1;
@@ -265,8 +265,8 @@ static struct ext_itf *lookup_ext_by_instance(struct ospf_lsa *lsa)
  *------------------------------------------------------------------------*/
 
 /* Extended Prefix TLV - RFC7684 section 2.1 */
-static void set_ext_prefix(struct ext_itf *exti, u_int8_t route_type,
-                          u_int8_t flags, struct prefix_ipv4 p)
+static void set_ext_prefix(struct ext_itf *exti, uint8_t route_type,
+                          uint8_t flags, struct prefix_ipv4 p)
 {
 
        TLV_TYPE(exti->prefix) = htons(EXT_TLV_PREFIX);
@@ -281,7 +281,7 @@ static void set_ext_prefix(struct ext_itf *exti, u_int8_t route_type,
 }
 
 /* Extended Link TLV - RFC7684 section 3.1 */
-static void set_ext_link(struct ext_itf *exti, u_int8_t type, struct in_addr id,
+static void set_ext_link(struct ext_itf *exti, uint8_t type, struct in_addr id,
                         struct in_addr data)
 {
 
@@ -294,11 +294,11 @@ static void set_ext_link(struct ext_itf *exti, u_int8_t type, struct in_addr id,
 }
 
 /* Prefix SID SubTLV - section 5 */
-static void set_prefix_sid(struct ext_itf *exti, u_int8_t algorithm,
-                          u_int32_t value, int value_type)
+static void set_prefix_sid(struct ext_itf *exti, uint8_t algorithm,
+                          uint32_t value, int value_type)
 {
 
-       u_int8_t flags;
+       uint8_t flags;
 
        if ((algorithm != SR_ALGORITHM_SPF)
            && (algorithm != SR_ALGORITHM_STRICT_SPF)) {
@@ -336,11 +336,11 @@ static void set_prefix_sid(struct ext_itf *exti, u_int8_t algorithm,
 }
 
 /* Adjacency SID SubTLV - section 6.1 */
-static void set_adj_sid(struct ext_itf *exti, bool backup, u_int32_t value,
+static void set_adj_sid(struct ext_itf *exti, bool backup, uint32_t value,
                        int value_type)
 {
        int index;
-       u_int8_t flags;
+       uint8_t flags;
 
        /* Determine which ADJ_SID must be set: nominal or backup */
        if (backup) {
@@ -377,12 +377,12 @@ static void set_adj_sid(struct ext_itf *exti, bool backup, u_int32_t value,
 }
 
 /* LAN Adjacency SID SubTLV - section 6.2 */
-static void set_lan_adj_sid(struct ext_itf *exti, bool backup, u_int32_t value,
+static void set_lan_adj_sid(struct ext_itf *exti, bool backup, uint32_t value,
                            int value_type, struct in_addr neighbor_id)
 {
 
        int index;
-       u_int8_t flags;
+       uint8_t flags;
 
        /* Determine which ADJ_SID must be set: nominal or backup */
        if (backup) {
@@ -437,7 +437,7 @@ static void set_rmt_itf_addr(struct ext_itf *exti, struct in_addr rmtif)
  *
  * @return instance number if update is OK, 0 otherwise
  */
-int ospf_ext_schedule_prefix_index(struct interface *ifp, u_int32_t index,
+int ospf_ext_schedule_prefix_index(struct interface *ifp, uint32_t index,
                                   struct prefix_ipv4 *p)
 {
        int rc = 0;
@@ -659,7 +659,7 @@ static void ospf_ext_link_nsm_change(struct ospf_neighbor *nbr, int old_status)
 {
        struct ospf_interface *oi = nbr->oi;
        struct ext_itf *exti;
-       u_int32_t label;
+       uint32_t label;
 
        /* Process Neighbor only when its state is NSM Full */
        if (nbr->state != NSM_Full)
@@ -915,8 +915,8 @@ static struct ospf_lsa *ospf_ext_pref_lsa_new(struct ospf_area *area,
        u_char options, lsa_type;
        struct in_addr lsa_id;
        struct in_addr router_id;
-       u_int32_t tmp;
-       u_int16_t length;
+       uint32_t tmp;
+       uint16_t length;
 
        /* Sanity Check */
        if (exti == NULL)
@@ -999,8 +999,8 @@ static struct ospf_lsa *ospf_ext_link_lsa_new(struct ospf_area *area,
        struct ospf_lsa *new = NULL;
        u_char options, lsa_type;
        struct in_addr lsa_id;
-       u_int32_t tmp;
-       u_int16_t length;
+       uint32_t tmp;
+       uint16_t length;
 
        /* Sanity Check */
        if (exti == NULL)
@@ -1435,7 +1435,7 @@ static void ospf_ext_pref_lsa_schedule(struct ext_itf *exti,
        struct ospf_lsa lsa;
        struct lsa_header lsah;
        struct ospf *top;
-       u_int32_t tmp;
+       uint32_t tmp;
 
        memset(&lsa, 0, sizeof(lsa));
        memset(&lsah, 0, sizeof(lsah));
@@ -1502,7 +1502,7 @@ static void ospf_ext_link_lsa_schedule(struct ext_itf *exti,
        struct ospf_lsa lsa;
        struct lsa_header lsah;
        struct ospf *top;
-       u_int32_t tmp;
+       uint32_t tmp;
 
        memset(&lsa, 0, sizeof(lsa));
        memset(&lsah, 0, sizeof(lsah));
@@ -1576,7 +1576,7 @@ static void ospf_ext_lsa_schedule(struct ext_itf *exti, enum lsa_opcode op)
  * Followings are vty show functions.
  *------------------------------------------------------------------------*/
 /* Cisco experimental SubTLV */
-static u_int16_t show_vty_ext_link_rmt_itf_addr(struct vty *vty,
+static uint16_t show_vty_ext_link_rmt_itf_addr(struct vty *vty,
                                                struct tlv_header *tlvh)
 {
        struct ext_subtlv_rmt_itf_addr *top;
@@ -1591,7 +1591,7 @@ static u_int16_t show_vty_ext_link_rmt_itf_addr(struct vty *vty,
 }
 
 /* Adjacency SID SubTLV */
-static u_int16_t show_vty_ext_link_adj_sid(struct vty *vty,
+static uint16_t show_vty_ext_link_adj_sid(struct vty *vty,
                                           struct tlv_header *tlvh)
 {
        struct ext_subtlv_adj_sid *top = (struct ext_subtlv_adj_sid *)tlvh;
@@ -1610,7 +1610,7 @@ static u_int16_t show_vty_ext_link_adj_sid(struct vty *vty,
 }
 
 /* LAN Adjacency SubTLV */
-static u_int16_t show_vty_ext_link_lan_adj_sid(struct vty *vty,
+static uint16_t show_vty_ext_link_lan_adj_sid(struct vty *vty,
                                               struct tlv_header *tlvh)
 {
        struct ext_subtlv_lan_adj_sid *top =
@@ -1630,7 +1630,7 @@ static u_int16_t show_vty_ext_link_lan_adj_sid(struct vty *vty,
        return TLV_SIZE(tlvh);
 }
 
-static u_int16_t show_vty_unknown_tlv(struct vty *vty, struct tlv_header *tlvh)
+static uint16_t show_vty_unknown_tlv(struct vty *vty, struct tlv_header *tlvh)
 {
        vty_out(vty, "    Unknown TLV: [type(0x%x), length(0x%x)]\n",
                ntohs(tlvh->type), ntohs(tlvh->length));
@@ -1639,12 +1639,12 @@ static u_int16_t show_vty_unknown_tlv(struct vty *vty, struct tlv_header *tlvh)
 }
 
 /* Extended Link Sub TLVs */
-static u_int16_t show_vty_link_info(struct vty *vty, struct tlv_header *ext)
+static uint16_t show_vty_link_info(struct vty *vty, struct tlv_header *ext)
 {
        struct ext_tlv_link *top = (struct ext_tlv_link *)ext;
        struct tlv_header *tlvh;
-       u_int16_t length = ntohs(top->header.length) - 3 * sizeof(u_int32_t);
-       u_int16_t sum = 0;
+       uint16_t length = ntohs(top->header.length) - 3 * sizeof(uint32_t);
+       uint16_t sum = 0;
 
        vty_out(vty,
                "  Extended Link TLV: Length %d\n       Link Type: 0x%x\n"
@@ -1680,7 +1680,7 @@ static void ospf_ext_link_show_info(struct vty *vty, struct ospf_lsa *lsa)
 {
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
        struct tlv_header *tlvh;
-       u_int16_t length = 0, sum = 0;
+       uint16_t length = 0, sum = 0;
 
        /* Initialize TLV browsing */
        length = ntohs(lsah->length) - OSPF_LSA_HEADER_SIZE;
@@ -1701,7 +1701,7 @@ static void ospf_ext_link_show_info(struct vty *vty, struct ospf_lsa *lsa)
 }
 
 /* Prefix SID SubTLV */
-static u_int16_t show_vty_ext_pref_pref_sid(struct vty *vty,
+static uint16_t show_vty_ext_pref_pref_sid(struct vty *vty,
                                            struct tlv_header *tlvh)
 {
        struct ext_subtlv_prefix_sid *top =
@@ -1722,12 +1722,12 @@ static u_int16_t show_vty_ext_pref_pref_sid(struct vty *vty,
 }
 
 /* Extended Prefix SubTLVs */
-static u_int16_t show_vty_pref_info(struct vty *vty, struct tlv_header *ext)
+static uint16_t show_vty_pref_info(struct vty *vty, struct tlv_header *ext)
 {
        struct ext_tlv_prefix *top = (struct ext_tlv_prefix *)ext;
        struct tlv_header *tlvh;
-       u_int16_t length = ntohs(top->header.length) - 2 * sizeof(u_int32_t);
-       u_int16_t sum = 0;
+       uint16_t length = ntohs(top->header.length) - 2 * sizeof(uint32_t);
+       uint16_t sum = 0;
 
        vty_out(vty,
                "  Extended Prefix TLV: Length %d\n\tRoute Type: %d\n"
@@ -1756,7 +1756,7 @@ static void ospf_ext_pref_show_info(struct vty *vty, struct ospf_lsa *lsa)
 {
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
        struct tlv_header *tlvh;
-       u_int16_t length = 0, sum = 0;
+       uint16_t length = 0, sum = 0;
 
        /* Initialize TLV browsing */
        length = ntohs(lsah->length) - OSPF_LSA_HEADER_SIZE;
index 5e185542032d3a1707cb3c95c7fe44a8db0cfd89..318a9821f725875381ca7f12b89e29f5d8dab0bb 100644 (file)
 #define EXT_TLV_PREFIX_SIZE            8
 struct ext_tlv_prefix {
        struct tlv_header header;
-       u_int8_t route_type;
-       u_int8_t pref_length;
-       u_int8_t af;
-       u_int8_t flags;
+       uint8_t route_type;
+       uint8_t pref_length;
+       uint8_t af;
+       uint8_t flags;
        struct in_addr address;
 };
 
@@ -125,8 +125,8 @@ struct ext_tlv_prefix {
 #define EXT_TLV_LINK_SIZE              12
 struct ext_tlv_link {
        struct tlv_header header;
-       u_int8_t link_type;
-       u_int8_t reserved[3];
+       uint8_t link_type;
+       uint8_t reserved[3];
        struct in_addr link_id;
        struct in_addr link_data;
 };
@@ -144,11 +144,11 @@ struct ospf_ext_lp {
        bool enabled;
 
        /* Flags to manage this Extended Prefix/Link Opaque LSA */
-       u_int32_t flags;
+       uint32_t flags;
 
        /* Scope is area Opaque Type 10 or AS Opaque LSA Type 11 for
         * Extended Prefix and area Opaque Type 10 for Extended Link */
-       u_int8_t scope;
+       uint8_t scope;
 
        /* area pointer if flooding is Type 10 Null if flooding is AS scope */
        struct ospf_area *area;
@@ -161,8 +161,8 @@ struct ospf_ext_lp {
 /* Structure to aggregate interfaces information for Extended Prefix/Link */
 struct ext_itf {
        /* 24-bit Opaque-ID field value according to RFC 7684 specification */
-       u_int32_t instance;
-       u_int8_t type; /* Extended Prefix (7) or Link (8) */
+       uint32_t instance;
+       uint8_t type; /* Extended Prefix (7) or Link (8) */
 
        /* Reference pointer to a Zebra-interface. */
        struct interface *ifp;
@@ -171,7 +171,7 @@ struct ext_itf {
        struct ospf_area *area;
 
        /* Flags to manage this link parameters. */
-       u_int32_t flags;
+       uint32_t flags;
 
        /* SID type: Node, Adjacency or LAN Adjacency */
        enum sid_type stype;
@@ -191,6 +191,6 @@ struct ext_itf {
 extern int ospf_ext_init(void);
 extern void ospf_ext_term(void);
 extern void ospf_ext_update_sr(bool);
-extern int ospf_ext_schedule_prefix_index(struct interface *, u_int32_t,
+extern int ospf_ext_schedule_prefix_index(struct interface *, uint32_t,
                                          struct prefix_ipv4 *);
 #endif /* _FRR_OSPF_EXT_PREF_H_ */
index 0a6917dce7f1420b3dfeedb80b08ebd394a0138d..db68ec9decd2c0520bb7bfd3097df413deecaaa8 100644 (file)
@@ -443,7 +443,7 @@ static void set_pce_cap_flag(u_int32_t cap, struct ospf_pce_info *pce)
 /* Segment Routing TLV setter */
 
 /* Algorithm SubTLV - section 3.1 */
-static void set_sr_algorithm(u_int8_t algo)
+static void set_sr_algorithm(uint8_t algo)
 {
 
        OspfRI.sr_info.algo.value[0] = algo;
@@ -452,13 +452,13 @@ static void set_sr_algorithm(u_int8_t algo)
 
        /* Set TLV type and length == only 1 Algorithm */
        TLV_TYPE(OspfRI.sr_info.algo) = htons(RI_SR_TLV_SR_ALGORITHM);
-       TLV_LEN(OspfRI.sr_info.algo) = htons(sizeof(u_int8_t));
+       TLV_LEN(OspfRI.sr_info.algo) = htons(sizeof(uint8_t));
 
        return;
 }
 
 /* unset Aglogithm SubTLV */
-static void unset_sr_algorithm(u_int8_t algo)
+static void unset_sr_algorithm(uint8_t algo)
 {
 
        for (int i = 0; i < ALGORITHM_COUNT; i++)
@@ -477,7 +477,7 @@ static void set_sr_sid_label_range(struct sr_srgb srgb)
        /* Set Header */
        TLV_TYPE(OspfRI.sr_info.range) = htons(RI_SR_TLV_SID_LABEL_RANGE);
        TLV_LEN(OspfRI.sr_info.range) =
-               htons(SUBTLV_SID_LABEL_SIZE + sizeof(u_int32_t));
+               htons(SUBTLV_SID_LABEL_SIZE + sizeof(uint32_t));
        /* Set Range Size */
        OspfRI.sr_info.range.size = htonl(SET_RANGE_SIZE(srgb.range_size));
        /* Set Lower bound label SubTLV */
@@ -501,10 +501,10 @@ static void unset_sr_sid_label_range()
 }
 
 /* Set Maximum Stack Depth for this router */
-static void set_sr_node_msd(u_int8_t msd)
+static void set_sr_node_msd(uint8_t msd)
 {
        TLV_TYPE(OspfRI.sr_info.msd) = htons(RI_SR_TLV_NODE_MSD);
-       TLV_LEN(OspfRI.sr_info.msd) = htons(sizeof(u_int32_t));
+       TLV_LEN(OspfRI.sr_info.msd) = htons(sizeof(uint32_t));
        OspfRI.sr_info.msd.value = msd;
 
        return;
@@ -604,7 +604,7 @@ static int is_mandated_params_set(struct ospf_router_info ori)
  *
  * @return none
  */
-void ospf_router_info_update_sr(bool enable, struct sr_srgb srgb, u_int8_t msd)
+void ospf_router_info_update_sr(bool enable, struct sr_srgb srgb, uint8_t msd)
 {
 
        /* First activate and initialize Router Information is necessary */
@@ -1234,7 +1234,7 @@ static u_int16_t show_vty_pce_info(struct vty *vty, struct tlv_header *ri,
 }
 
 /* Display Segment Routing Algorithm TLV information */
-static u_int16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
+static uint16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
 {
        struct ri_sr_tlv_sr_algorithm *algo =
                (struct ri_sr_tlv_sr_algorithm *)tlvh;
@@ -1281,7 +1281,7 @@ static u_int16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
 }
 
 /* Display Segment Routing SID/Label Range TLV information */
-static u_int16_t show_vty_sr_range(struct vty *vty, struct tlv_header *tlvh)
+static uint16_t show_vty_sr_range(struct vty *vty, struct tlv_header *tlvh)
 {
        struct ri_sr_tlv_sid_label_range *range =
                (struct ri_sr_tlv_sid_label_range *)tlvh;
@@ -1306,7 +1306,7 @@ static u_int16_t show_vty_sr_range(struct vty *vty, struct tlv_header *tlvh)
 }
 
 /* Display Segment Routing Maximum Stack Depth TLV information */
-static u_int16_t show_vty_sr_msd(struct vty *vty, struct tlv_header *tlvh)
+static uint16_t show_vty_sr_msd(struct vty *vty, struct tlv_header *tlvh)
 {
        struct ri_sr_tlv_node_msd *msd = (struct ri_sr_tlv_node_msd *)tlvh;
 
index 3fb83141b5e0be7065c0b2e7224e0a3f89e571a0..7f3a5a22262b3b519bd98532ee352ac9859b41c7 100644 (file)
@@ -169,7 +169,7 @@ struct ri_pce_subtlv_cap_flag {
 
 /* Structure to share flooding scope info for Segment Routing */
 struct scope_info {
-       u_int8_t scope;
+       uint8_t scope;
        struct in_addr area_id;
 };
 
@@ -177,6 +177,6 @@ struct scope_info {
 extern int ospf_router_info_init(void);
 extern void ospf_router_info_term(void);
 extern int ospf_router_info_enable(void);
-extern void ospf_router_info_update_sr(bool, struct sr_srgb, u_int8_t);
+extern void ospf_router_info_update_sr(bool, struct sr_srgb, uint8_t);
 extern struct scope_info ospf_router_info_get_flooding_scope(void);
 #endif /* _ZEBRA_OSPF_ROUTER_INFO_H */
index 3c30a337d56f5ce9ee097cc492f2bc5a1d91352d..eae488f779d35c275c0c9fe356dad17f62292f75 100644 (file)
@@ -412,7 +412,7 @@ void ospf_sr_term(void)
  */
 
 /* Compute label from index */
-static mpls_label_t index2label(u_int32_t index, struct sr_srgb srgb)
+static mpls_label_t index2label(uint32_t index, struct sr_srgb srgb)
 {
        mpls_label_t label;
 
@@ -667,7 +667,7 @@ static int ospf_zebra_send_mpls_ftn(int cmd, struct sr_nhlfe nhlfe)
 
        memset(&api, 0, sizeof(api));
        api.vrf_id = VRF_DEFAULT;
-       api.type = ZEBRA_ROUTE_OSPF_SR;
+       api.type = ZEBRA_ROUTE_OSPF;
        api.safi = SAFI_UNICAST;
        memcpy(&api.prefix, &nhlfe.prefv4, sizeof(struct prefix_ipv4));
 
@@ -695,8 +695,6 @@ static int ospf_zebra_send_mpls_ftn(int cmd, struct sr_nhlfe nhlfe)
                           nhlfe.prefv4.prefixlen, nhlfe.ifindex);
 
        return (zclient_route_send(cmd, zclient, &api));
-
-       return -1;
 }
 
 /* Add new NHLFE entry for SID */
@@ -743,7 +741,7 @@ static struct sr_link *get_ext_link_sid(struct tlv_header *tlvh)
        struct ext_subtlv_rmt_itf_addr *rmt_itf;
 
        struct tlv_header *sub_tlvh;
-       u_int16_t length = 0, sum = 0, i = 0;
+       uint16_t length = 0, sum = 0, i = 0;
 
        srl = XCALLOC(MTYPE_OSPF_SR_PARAMS, sizeof(struct sr_link));
 
@@ -828,7 +826,7 @@ static struct sr_prefix *get_ext_prefix_sid(struct tlv_header *tlvh)
        struct ext_subtlv_prefix_sid *psid;
 
        struct tlv_header *sub_tlvh;
-       u_int16_t length = 0, sum = 0;
+       uint16_t length = 0, sum = 0;
 
        srp = XCALLOC(MTYPE_OSPF_SR_PARAMS, sizeof(struct sr_prefix));
 
@@ -1103,7 +1101,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
        struct ri_sr_tlv_sid_label_range *ri_srgb;
        struct ri_sr_tlv_sr_algorithm *algo;
        struct sr_srgb srgb;
-       u_int16_t length = 0, sum = 0;
+       uint16_t length = 0, sum = 0;
 
        if (IS_DEBUG_OSPF_SR)
                zlog_debug(
@@ -1274,7 +1272,7 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
        struct sr_link *srl;
 
-       u_int16_t length, sum;
+       uint16_t length, sum;
 
        if (IS_DEBUG_OSPF_SR)
                zlog_debug(
@@ -1329,7 +1327,7 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
        struct sr_link *srl;
        struct sr_node *srn;
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
-       u_int32_t instance = ntohl(lsah->id.s_addr);
+       uint32_t instance = ntohl(lsah->id.s_addr);
 
        if (IS_DEBUG_OSPF_SR)
                zlog_debug(
@@ -1390,7 +1388,7 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
        struct sr_prefix *srp;
 
-       u_int16_t length, sum;
+       uint16_t length, sum;
 
        if (IS_DEBUG_OSPF_SR)
                zlog_debug(
@@ -1445,7 +1443,7 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
        struct sr_prefix *srp;
        struct sr_node *srn;
        struct lsa_header *lsah = (struct lsa_header *)lsa->data;
-       u_int32_t instance = ntohl(lsah->id.s_addr);
+       uint32_t instance = ntohl(lsah->id.s_addr);
 
        if (IS_DEBUG_OSPF_SR)
                zlog_debug(
@@ -1499,9 +1497,9 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
 
 /* Get Label for Extended Link SID */
 /* TODO: To be replace by Zebra Label Manager */
-u_int32_t get_ext_link_label_value(void)
+uint32_t get_ext_link_label_value(void)
 {
-       static u_int32_t label = ADJ_SID_MIN - 1;
+       static uint32_t label = ADJ_SID_MIN - 1;
 
        if (label < ADJ_SID_MAX)
                label += 1;
@@ -1779,9 +1777,9 @@ DEFUN (sr_sid_label_range,
        "Lower-bound range in decimal (0-1048575)\n"
        "Upper-bound range in decimal (0-1048575)\n")
 {
-       u_int32_t upper;
-       u_int32_t lower;
-       u_int32_t size;
+       uint32_t upper;
+       uint32_t lower;
+       uint32_t size;
        int idx_low = 2;
        int idx_up = 3;
 
@@ -1869,7 +1867,7 @@ DEFUN (sr_node_msd,
        "Maximum Stack Depth for this router\n"
        "Maximum number of label that could be stack (1-16)\n")
 {
-       u_int32_t msd;
+       uint32_t msd;
        int idx_number = 2;
 
        if (!ospf_sr_enabled(vty))
index 38881642183fa968cecd9935a5537421e1c173ca..938e4740c6eb7386dca3c8242f3760ee98cb5efe 100644 (file)
@@ -64,7 +64,7 @@
 struct subtlv_sid_label {
        /* Length is 3 (20 rightmost bits MPLS label) or 4 (32 bits SID) */
        struct tlv_header header;
-       u_int32_t value;
+       uint32_t value;
 };
 
 /*
@@ -81,7 +81,7 @@ struct ri_sr_tlv_sr_algorithm {
 #define SR_ALGORITHM_UNSET       255
 #define ALGORITHM_COUNT          4
        /* Only 4 algorithms supported in this code */
-       u_int8_t value[ALGORITHM_COUNT];
+       uint8_t value[ALGORITHM_COUNT];
 };
 
 /* RI SID/Label Range TLV - section 3.2 */
@@ -90,7 +90,7 @@ struct ri_sr_tlv_sid_label_range {
        struct tlv_header header;
 /* Only 24 upper most bits are significant */
 #define SID_RANGE_LABEL_LENGTH 3
-       u_int32_t size;
+       uint32_t size;
        /* A SID/Label sub-TLV will follow. */
        struct subtlv_sid_label lower;
 };
@@ -99,9 +99,9 @@ struct ri_sr_tlv_sid_label_range {
 #define RI_SR_TLV_NODE_MSD             12
 struct ri_sr_tlv_node_msd {
        struct tlv_header header;
-       u_int8_t subtype; /* always = 1 */
-       u_int8_t value;
-       u_int16_t padding;
+       uint8_t subtype; /* always = 1 */
+       uint8_t value;
+       uint16_t padding;
 };
 
 /*
@@ -130,11 +130,11 @@ struct ri_sr_tlv_node_msd {
 #define EXT_SUBTLV_PREFIX_RANGE_SIZE   12
 struct ext_tlv_prefix_range {
        struct tlv_header header;
-       u_int8_t pref_length;
-       u_int8_t af;
-       u_int16_t range_size;
-       u_int8_t flags;
-       u_int8_t reserved[3];
+       uint8_t pref_length;
+       uint8_t af;
+       uint16_t range_size;
+       uint8_t flags;
+       uint8_t reserved[3];
        struct in_addr address;
 };
 
@@ -143,11 +143,11 @@ struct ext_tlv_prefix_range {
 #define EXT_SUBTLV_PREFIX_SID_SIZE     8
 struct ext_subtlv_prefix_sid {
        struct tlv_header header;
-       u_int8_t flags;
-       u_int8_t reserved;
-       u_int8_t mtid;
-       u_int8_t algorithm;
-       u_int32_t value;
+       uint8_t flags;
+       uint8_t reserved;
+       uint8_t mtid;
+       uint8_t algorithm;
+       uint32_t value;
 };
 
 /* Adj-SID Sub-TLV - section 6.1 */
@@ -155,11 +155,11 @@ struct ext_subtlv_prefix_sid {
 #define EXT_SUBTLV_ADJ_SID_SIZE                8
 struct ext_subtlv_adj_sid {
        struct tlv_header header;
-       u_int8_t flags;
-       u_int8_t reserved;
-       u_int8_t mtid;
-       u_int8_t weight;
-       u_int32_t value;
+       uint8_t flags;
+       uint8_t reserved;
+       uint8_t mtid;
+       uint8_t weight;
+       uint32_t value;
 };
 
 /* LAN Adj-SID Sub-TLV - section 6.2 */
@@ -167,12 +167,12 @@ struct ext_subtlv_adj_sid {
 #define EXT_SUBTLV_LAN_ADJ_SID_SIZE    12
 struct ext_subtlv_lan_adj_sid {
        struct tlv_header header;
-       u_int8_t flags;
-       u_int8_t reserved;
-       u_int8_t mtid;
-       u_int8_t weight;
+       uint8_t flags;
+       uint8_t reserved;
+       uint8_t mtid;
+       uint8_t weight;
        struct in_addr neighbor_id;
-       u_int32_t value;
+       uint32_t value;
 };
 
 /*
@@ -182,8 +182,8 @@ struct ext_subtlv_lan_adj_sid {
 
 /* Structure aggregating SRGB info retrieved from an lsa */
 struct sr_srgb {
-       u_int32_t range_size;
-       u_int32_t lower_bound;
+       uint32_t range_size;
+       uint32_t lower_bound;
 };
 
 /* SID type to make difference between loopback interfaces and others */
@@ -198,7 +198,7 @@ struct ospf_sr_db {
        bool update;
 
        /* Flooding Scope: Area = 10 or AS = 11 */
-       u_int8_t scope;
+       uint8_t scope;
 
        /* FRR SR node */
        struct sr_node *self;
@@ -212,26 +212,26 @@ struct ospf_sr_db {
        /* Local SR info announced in Router Info LSA */
 
        /* Algorithms supported by the node */
-       u_int8_t algo[ALGORITHM_COUNT];
+       uint8_t algo[ALGORITHM_COUNT];
        /*
         * Segment Routing Global Block i.e. label range
         * Only one range supported in this code
         */
        struct sr_srgb srgb;
        /* Maximum SID Depth supported by the node */
-       u_int8_t msd;
+       uint8_t msd;
 };
 
 /* Structure aggregating all received SR info from LSAs by node */
 struct sr_node {
        struct in_addr adv_router; /* used to identify sender of LSA */
        /* 24-bit Opaque-ID field value according to RFC 7684 specification */
-       u_int32_t instance;
+       uint32_t instance;
 
-       u_int8_t algo[ALGORITHM_COUNT]; /* Algorithms supported by the node */
+       uint8_t algo[ALGORITHM_COUNT]; /* Algorithms supported by the node */
        /* Segment Routing Global Block i.e. label range */
        struct sr_srgb srgb;
-       u_int8_t msd; /* Maximum SID Depth */
+       uint8_t msd; /* Maximum SID Depth */
 
        /* List of Prefix & Link advertise by this node */
        struct list *ext_prefix; /* For Node SID */
@@ -256,13 +256,13 @@ struct sr_nhlfe {
 struct sr_link {
        struct in_addr adv_router; /* used to identify sender of LSA */
        /* 24-bit Opaque-ID field value according to RFC 7684 specification */
-       u_int32_t instance;
+       uint32_t instance;
 
        /* Flags to manage this link parameters. */
-       u_int32_t flags[2];
+       uint32_t flags[2];
 
        /* Segment Routing ID */
-       u_int32_t sid[2];
+       uint32_t sid[2];
        enum sid_type type;
 
        /* SR NHLFE for this link */
@@ -276,13 +276,13 @@ struct sr_link {
 struct sr_prefix {
        struct in_addr adv_router; /* used to identify sender of LSA */
        /* 24-bit Opaque-ID field value according to RFC 7684 specification */
-       u_int32_t instance;
+       uint32_t instance;
 
        /* Flags to manage this prefix parameters. */
-       u_int32_t flags;
+       uint32_t flags;
 
        /* Segment Routing ID */
-       u_int32_t sid;
+       uint32_t sid;
        enum sid_type type;
 
        /* SR NHLFE for this prefix */
@@ -308,7 +308,7 @@ extern void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *);
 extern void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *);
 extern void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *);
 /* Segment Routing configuration functions */
-extern u_int32_t get_ext_link_label_value(void);
+extern uint32_t get_ext_link_label_value(void);
 extern void ospf_sr_config_write_router(struct vty *);
 /* Segment Routing re-routing function */
 extern void ospf_sr_update_timer_add(struct ospf *);