Skip to content

Commit

Permalink
bgp: Initial BGP Link State support
Browse files Browse the repository at this point in the history
This commit is a first attempt to backport an old quagga implementation of
BGP Link State into FRR.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
  • Loading branch information
odd22 authored and louis-6wind committed Dec 29, 2022
1 parent 185382e commit 44101af
Show file tree
Hide file tree
Showing 18 changed files with 3,774 additions and 20 deletions.
387 changes: 385 additions & 2 deletions bgpd/bgp_attr.c

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct bgp_attr_srv6_l3vpn {
uint8_t transposition_offset;
};


/* BGP core attribute structure. */
struct attr {
/* AS Path structure */
Expand All @@ -174,6 +175,10 @@ struct attr {
/* Path origin attribute */
uint8_t origin;

/* BGP Link-State attributes*/
struct mp_bgpls_nlri *mp_bgpls_nlri; /* BGP LS extension NLRI */
struct ls_bgpls *link_state_attr; /* BGP Link State attribute */

/* PMSI tunnel type (RFC 6514). */
enum pta_type pmsi_tnl_type;

Expand Down Expand Up @@ -390,6 +395,7 @@ extern void bgp_attr_finish(void);
extern enum bgp_attr_parse_ret
bgp_attr_parse(struct peer *peer, struct attr *attr, bgp_size_t size,
struct bgp_nlri *mp_update, struct bgp_nlri *mp_withdraw);
extern void bgp_attr_undup(struct attr *new, struct attr *old);
extern struct attr *bgp_attr_intern(struct attr *attr);
extern void bgp_attr_unintern_sub(struct attr *attr);
extern void bgp_attr_unintern(struct attr **pattr);
Expand Down Expand Up @@ -436,6 +442,11 @@ extern int bgp_mp_unreach_parse(struct bgp_attr_parser_args *args,
extern enum bgp_attr_parse_ret
bgp_attr_prefix_sid(struct bgp_attr_parser_args *args);

/* BGP-LS */
extern void bgp_put_link_state(struct stream *s, struct attr *attr);
extern int link_state_value(struct stream *s, struct peer *peer,
uint16_t l_type, uint16_t l_length);

extern struct bgp_attr_encap_subtlv *
encap_tlv_dup(struct bgp_attr_encap_subtlv *orig);

Expand Down
Loading

0 comments on commit 44101af

Please sign in to comment.