Revision 11cb6202 proto/bgp/bgp.h

View differences:

proto/bgp/bgp.h
16 16

  
17 17
struct bgp_config {
18 18
  struct proto_config c;
19
  unsigned int local_as, remote_as;
19
  u32 local_as, remote_as;
20 20
  ip_addr remote_ip;
21 21
  int multihop;				/* Number of hops if multihop */
22 22
  ip_addr multihop_via;			/* Multihop: address to route to */
......
47 47
  byte *notify_data;
48 48
  int error_flag;			/* Error state, ignore all input */
49 49
  int primary;				/* This connection is primary */
50
  u32 advertised_as;			/* Temporary value for AS number received */
50 51
  unsigned hold_time, keepalive_time;	/* Times calculated from my and neighbor's requirements */
51 52
};
52 53

  
53 54
struct bgp_proto {
54 55
  struct proto p;
55 56
  struct bgp_config *cf;		/* Shortcut to BGP configuration */
56
  unsigned local_as, remote_as;
57
  u32 local_as, remote_as;
57 58
  int is_internal;			/* Internal BGP connection (local_as == remote_as) */
59
  int as4_support;			/* Peer supports 4B AS numbers [RFC4893] */
58 60
  u32 local_id;				/* BGP identifier of this router */
59 61
  u32 remote_id;			/* BGP identifier of the neighbor */
60 62
  struct bgp_conn *conn;		/* Connection we have established */
......
100 102

  
101 103
extern struct linpool *bgp_linpool;
102 104

  
105
extern int bgp_as4_support;
106

  
107

  
103 108
void bgp_start_timer(struct timer *t, int value);
104 109
void bgp_check(struct bgp_config *c);
105 110
void bgp_error(struct bgp_conn *c, unsigned code, unsigned subcode, byte *data, int len);
......
122 127
void bgp_rt_notify(struct proto *, struct network *, struct rte *, struct rte *, struct ea_list *);
123 128
int bgp_import_control(struct proto *, struct rte **, struct ea_list **, struct linpool *);
124 129
void bgp_attr_init(struct bgp_proto *);
125
unsigned int bgp_encode_attrs(byte *w, struct ea_list *attrs, int remains);
130
unsigned int bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains);
126 131
void bgp_free_bucket(struct bgp_proto *p, struct bgp_bucket *buck);
127 132
void bgp_get_route_info(struct rte *, byte *buf, struct ea_list *attrs);
128 133

  
......
165 170
#define BA_MP_REACH_NLRI	0x0e	/* [RFC2283] */
166 171
#define BA_MP_UNREACH_NLRI	0x0f
167 172
#define BA_EXTENDED_COMM	0x10	/* draft-ramachandra-bgp-ext-communities */
173
#define BA_AS4_PATH             0x11    /* [RFC4893] */
174
#define BA_AS4_AGGREGATOR       0x12
168 175

  
169 176
/* BGP states */
170 177

  

Also available in: Unified diff