bgp_mp_reach_parse (struct bgp_attr_parser_args *args,
struct bgp_nlri *mp_update)
{
- afi_t afi;
- safi_t safi;
- afi_t pkt_afi, afi;
++ iana_afi_t pkt_afi;
++ afi_t afi;
+ safi_t pkt_safi, safi;
bgp_size_t nlri_len;
size_t start;
struct stream *s;
struct bgp_nlri *mp_withdraw)
{
struct stream *s;
- afi_t pkt_afi, afi;
++ iana_afi_t pkt_afi;
+ afi_t afi;
- safi_t safi;
+ safi_t pkt_safi, safi;
u_int16_t withdraw_len;
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
struct attr *attr)
{
size_t sizep;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
/* Set extended bit always to encode the attribute length as 2 bytes */
stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_EXTLEN);
bgp_packet_mpunreach_start (struct stream *s, afi_t afi, safi_t safi)
{
unsigned long attrlen_pnt;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
/* Set extended bit always to encode the attribute length as 2 bytes */
stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_EXTLEN);
{
struct capability_mp_data mpc;
struct stream *s = BGP_INPUT (peer);
--
++ afi_t afi;
++ safi_t safi;
++
/* Verify length is 4 */
if (hdr->length != 4)
{
zlog_debug ("%s OPEN has MP_EXT CAP for afi/safi: %u/%u",
peer->host, mpc.afi, mpc.safi);
- if (!bgp_afi_safi_valid_indices (mpc.afi, &mpc.safi))
+ /* Convert AFI, SAFI to internal values, check. */
- if (bgp_map_afi_safi_iana2int (mpc.afi, mpc.safi, &mpc.afi, &mpc.safi))
++ if (bgp_map_afi_safi_iana2int (mpc.afi, mpc.safi, &afi, &safi))
return -1;
/* Now safi remapped, and afi/safi are valid array indices */
-- peer->afc_recv[mpc.afi][mpc.safi] = 1;
++ peer->afc_recv[afi][safi] = 1;
-- if (peer->afc[mpc.afi][mpc.safi])
-- peer->afc_nego[mpc.afi][mpc.safi] = 1;
++ if (peer->afc[afi][safi])
++ peer->afc_nego[afi][safi] = 1;
else
return -1;
}
static void
--bgp_capability_orf_not_support (struct peer *peer, afi_t afi, safi_t safi,
++bgp_capability_orf_not_support (struct peer *peer, iana_afi_t afi, safi_t safi,
u_char type, u_char mode)
{
if (bgp_debug_neighbor_events(peer))
{
struct stream *s = BGP_INPUT (peer);
struct capability_orf_entry entry;
- afi_t pkt_afi, afi;
++ iana_afi_t pkt_afi;
+ afi_t afi;
- safi_t safi;
+ safi_t pkt_safi, safi;
u_char type;
u_char mode;
u_int16_t sm_cap = 0; /* capability send-mode receive */
return 0;
}
- entry.mpc.afi = afi;
++ entry.mpc.afi = pkt_afi;
+ entry.mpc.safi = safi;
+
/* validate number field */
if (CAPABILITY_CODE_ORF_LEN + (entry.num * 2) > hdr->length)
{
while (stream_get_getp (s) + 4 <= end)
{
- afi_t afi = stream_getw (s);
- safi_t safi = stream_getc (s);
+ afi_t afi;
+ safi_t safi;
- afi_t pkt_afi = stream_getw (s);
++ iana_afi_t pkt_afi = stream_getw (s);
+ safi_t pkt_safi = stream_getc (s);
u_char flag = stream_getc (s);
- if (!bgp_afi_safi_valid_indices (afi, &safi))
+ /* Convert AFI, SAFI to internal values, check. */
+ if (bgp_map_afi_safi_iana2int (pkt_afi, pkt_safi, &afi, &safi))
{
if (bgp_debug_neighbor_events(peer))
zlog_debug ("%s Addr-family %d/%d(afi/safi) not supported."
while (stream_get_getp (s) + 4 <= end)
{
- afi_t afi = stream_getw (s);
- safi_t safi = stream_getc (s);
+ afi_t afi;
+ safi_t safi;
- afi_t pkt_afi = stream_getw (s);
++ iana_afi_t pkt_afi = stream_getw (s);
+ safi_t pkt_safi = stream_getc (s);
u_char send_receive = stream_getc (s);
if (bgp_debug_neighbor_events(peer))
while (stream_get_getp (s) + 6 <= end)
{
- afi_t afi = stream_getw (s);
- safi_t safi = stream_getw (s);
- afi_t nh_afi = stream_getw (s);
- afi_t afi, pkt_afi = stream_getw (s);
++ iana_afi_t pkt_afi = stream_getw (s);
++ afi_t afi;
+ safi_t safi, pkt_safi = stream_getw (s);
- afi_t nh_afi, pkt_nh_afi = stream_getw (s);
++ iana_afi_t pkt_nh_afi = stream_getw (s);
++ afi_t nh_afi;
if (bgp_debug_neighbor_events(peer))
zlog_debug ("%s Received with afi/safi/next-hop afi: %u/%u/%u",
unsigned long orfp;
unsigned long numberp;
int number_of_orfs = 0;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
- if (safi == SAFI_MPLS_VPN)
- safi = SAFI_MPLS_LABELED_VPN;
+ /* Convert AFI, SAFI to values for packet. */
+ bgp_map_afi_safi_int2iana (afi, safi, &pkt_afi, &pkt_safi);
stream_putc (s, BGP_OPEN_OPT_CAP);
capp = stream_get_endp (s); /* Set Capability Len Pointer */
{
u_char len;
unsigned long cp, capp, rcapp;
- afi_t afi, pkt_afi;
++ iana_afi_t pkt_afi;
+ afi_t afi;
- safi_t safi;
+ safi_t safi, pkt_safi;
as_t local_as;
u_int32_t restart_time;
u_char afi_safi_count = 0;
/* Generic MP capability data */
struct capability_mp_data
{
-- afi_t afi;
++ iana_afi_t afi;
u_char reserved;
safi_t safi;
};
bgp_update_packet_eor (struct peer *peer, afi_t afi, safi_t safi)
{
struct stream *s;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
if (DISABLE_BGP_ANNOUNCE)
return NULL;
struct stream *s;
struct bgp_filter *filter;
int orf_refresh = 0;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
if (DISABLE_BGP_ANNOUNCE)
return;
int capability_code, int action)
{
struct stream *s;
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
- /* Adjust safi code. */
- if (safi == SAFI_MPLS_VPN)
- safi = SAFI_MPLS_LABELED_VPN;
+ /* Convert AFI, SAFI to values for packet. */
+ bgp_map_afi_safi_int2iana (afi, safi, &pkt_afi, &pkt_safi);
s = stream_new (BGP_MAX_PACKET_SIZE);
static void
bgp_route_refresh_receive (struct peer *peer, bgp_size_t size)
{
- afi_t pkt_afi, afi;
++ iana_afi_t pkt_afi;
+ afi_t afi;
- safi_t safi;
+ safi_t pkt_safi, safi;
struct stream *s;
struct peer_af *paf;
struct update_group *updgrp;
struct capability_mp_data mpc;
struct capability_header *hdr;
u_char action;
- afi_t pkt_afi, afi;
++ iana_afi_t pkt_afi;
+ afi_t afi;
- safi_t safi;
+ safi_t pkt_safi, safi;
end = pnt + length;
}
int
--bgp_maximum_prefix_overflow (struct peer *peer, afi_t afi,
++bgp_maximum_prefix_overflow (struct peer *peer, afi_t afi,
safi_t safi, int always)
{
- afi_t pkt_afi;
++ iana_afi_t pkt_afi;
+ safi_t pkt_safi;
+
if (!CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
return 0;
return 0;
}
-bgp_map_afi_safi_iana2int (afi_t pkt_afi, safi_t pkt_safi,
+ int
- afi_t *pkt_afi, safi_t *pkt_safi)
++bgp_map_afi_safi_iana2int (iana_afi_t pkt_afi, safi_t pkt_safi,
+ afi_t *afi, safi_t *safi)
+ {
+ /* Map from IANA values to internal values, return error if
+ * values are unrecognized.
+ */
+ *afi = afi_iana2int (pkt_afi);
+ *safi = safi_iana2int (pkt_safi);
+ if (*afi == AFI_MAX || *safi == SAFI_MAX)
+ return -1;
+
+ return 0;
+ }
+
+ int
+ bgp_map_afi_safi_int2iana (afi_t afi, safi_t safi,
++ iana_afi_t *pkt_afi, safi_t *pkt_safi)
+ {
+ /* Map from internal values to IANA values, return error if
+ * internal values are bad (unexpected).
+ */
+ if (afi == AFI_MAX || safi == SAFI_MAX)
+ return -1;
+ *pkt_afi = afi_int2iana (afi);
+ *pkt_safi = safi_int2iana (safi);
+ return 0;
+ }
+
struct peer_af *
peer_af_create (struct peer *peer, afi_t afi, safi_t safi)
{
extern int peer_cmp (struct peer *p1, struct peer *p2);
-bgp_map_afi_safi_iana2int (afi_t pkt_afi, safi_t pkt_safi,
+ extern int
- afi_t *pkt_afi, safi_t *pkt_safi);
++bgp_map_afi_safi_iana2int (iana_afi_t pkt_afi, safi_t pkt_safi,
+ afi_t *afi, safi_t *safi);
+ extern int
+ bgp_map_afi_safi_int2iana (afi_t afi, safi_t safi,
++ iana_afi_t *pkt_afi, safi_t *pkt_safi);
+
extern struct peer_af * peer_af_create (struct peer *, afi_t, safi_t);
extern struct peer_af * peer_af_find (struct peer *, afi_t, safi_t);
extern int peer_af_delete (struct peer *, afi_t, safi_t);
/* Subsequent Address Family Identifier. */
#define SAFI_UNICAST 1
#define SAFI_MULTICAST 2
- #define SAFI_RESERVED_3 3
- #define SAFI_MPLS_VPN 4
- #define SAFI_ENCAP 7 /* per IANA */
- #define SAFI_MAX 8
+ #define SAFI_MPLS_VPN 3
+ #define SAFI_RESERVED_4 4
+ #define SAFI_ENCAP 5
+ #define SAFI_RESERVED_5 5
+ #define SAFI_MAX 6
+
++#define IANA_SAFI_RESERVED 0
++#define IANA_SAFI_UNICAST 1
++#define IANA_SAFI_MULTICAST 2
++#define IANA_SAFI_ENCAP 7
++#define IANA_SAFI_MPLS_VPN 128
+
/*
* The above AFI and SAFI definitions are for internal use. The protocol
* definitions (IANA values) as for example used in BGP protocol packets
#define ROUTE_TAG_MAX UINT32_MAX
#define ROUTE_TAG_PRI PRIu32
-static inline afi_t afi_iana2int (afi_t afi)
++static inline afi_t afi_iana2int (iana_afi_t afi)
+ {
+ if (afi == IANA_AFI_IPV4)
+ return AFI_IP;
+ if (afi == IANA_AFI_IPV6)
+ return AFI_IP6;
+ return AFI_MAX;
+ }
+
-static inline afi_t afi_int2iana (afi_t afi)
++static inline iana_afi_t afi_int2iana (afi_t afi)
+ {
+ if (afi == AFI_IP)
+ return IANA_AFI_IPV4;
+ if (afi == AFI_IP6)
+ return IANA_AFI_IPV6;
+ return IANA_AFI_RESERVED;
+ }
+
+ static inline safi_t safi_iana2int (safi_t safi)
+ {
+ if (safi == IANA_SAFI_UNICAST)
+ return SAFI_UNICAST;
+ if (safi == IANA_SAFI_MULTICAST)
+ return SAFI_MULTICAST;
+ if (safi == IANA_SAFI_MPLS_VPN)
+ return SAFI_MPLS_VPN;
+ if (safi == IANA_SAFI_ENCAP)
+ return SAFI_ENCAP;
+ return SAFI_MAX;
+ }
+
+ static inline safi_t safi_int2iana (safi_t safi)
+ {
+ if (safi == SAFI_UNICAST)
+ return IANA_SAFI_UNICAST;
+ if (safi == SAFI_MULTICAST)
+ return IANA_SAFI_MULTICAST;
+ if (safi == SAFI_MPLS_VPN)
+ return IANA_SAFI_MPLS_VPN;
+ if (safi == SAFI_ENCAP)
+ return IANA_SAFI_ENCAP;
+ return IANA_SAFI_RESERVED;
+ }
+
#endif /* _ZEBRA_H */
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
DEBUG HINTS
- Check the source is issuing multicast packets with TTL high enough
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_HELLO_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
-
--*/
++s*/
#ifndef PIM_IFACE_H
#define PIM_IFACE_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_IFCHANNEL_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_IGMP_JOIN_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_IGMPV3_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_JOIN_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
break;
case 'v':
printf(PIMD_PROGNAME " version %s\n", PIMD_VERSION);
- print_version(QUAGGA_PROGNAME);
+ print_version(progname);
exit (0);
break;
-#ifdef PIM_ZCLIENT_DEBUG
- case 'Z':
- zclient_debug = 1;
- break;
-#endif
case 'h':
usage (0);
break;
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_NEIGHBOR_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_PIM_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_SIGNALS_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_SSMPINGD_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_STR_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_TLV_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_UTIL_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#ifndef PIM_VTY_H
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
++<<<<<<< HEAD
+
++=======
++>>>>>>> origin/master
*/
#include <zebra.h>