summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2012-03-23 12:15:00 +0000
committerChris Hall <chris.hall@highwayman.com>2012-03-23 12:15:00 +0000
commit4526b03b4c1ac32588cd8f9a3ea71bafe72db9ef (patch)
tree48c05781305667727e1dcd2207df6c25976bb488 /bgpd/bgp_attr.h
parent97f375b3e02e0f4ec18f68fbe36fc5ae16693d26 (diff)
parentaee567450eaf32877d00f47c4cc5d05c5fb85a51 (diff)
downloadquagga-ex23b.tar.bz2
quagga-ex23b.tar.xz
Merge branch 'master' into euro_ix_bex23b
v0.99.20ex23b -- Quagga 'master' as at 23-Mar-2012 Conflicts: bgpd/bgp_attr.c bgpd/bgp_attr.h Difference between 'master' and 0.99.20.1 is in these files. Handling of attributes has been worked over again to common up checks of the flags, and to use a common parsing structure, which reduces the clutter of parameters for the individual attribute parsing functions. bgpd/bgp_open.c bgpd/bgp_packet.c lib/thread.c ospfd/ospf_packet.c These were artifacts, caused by common patches in master and 0.99.20.1 -- and some twitchy-ness about whitespace !
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 6a235d54..553a91b5 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -146,12 +146,36 @@ typedef enum {
#define BGP_ATTR_PARSE_OK(ret) ((ret) >= BGP_ATTR_PARSE_PROCEED)
+typedef struct bgp_attr_parser_args {
+ struct peer* peer;
+ struct stream* s ;
+
+ uint8_t type;
+ uint8_t flags;
+ bgp_size_t length; /* attribute data length; */
+
+ struct attr attr;
+
+ struct aspath *as4_path ;
+
+ as_t as4_aggregator_as ;
+ struct in_addr as4_aggregator_addr ;
+
+ struct bgp_nlri update ;
+ struct bgp_nlri withdraw ;
+
+ struct bgp_nlri mp_update ;
+ struct bgp_nlri mp_withdraw ;
+
+ bool mp_eor ;
+} bgp_attr_parser_args_t ;
+
+typedef bgp_attr_parser_args_t* bgp_attr_parser_args ;
+
/* Prototypes. */
extern void bgp_attr_init (void);
extern void bgp_attr_finish (void);
-extern bgp_attr_parse_ret_t bgp_attr_parse (struct peer *, struct attr *,
- struct bgp_nlri *,
- struct bgp_nlri *, bool*);
+extern bgp_attr_parse_ret_t bgp_attr_parse (restrict bgp_attr_parser_args args);
extern int bgp_attr_check (struct peer *, struct attr *, bool);
extern struct attr_extra *bgp_attr_extra_get (struct attr *);
extern void bgp_attr_extra_free (struct attr *);
@@ -187,10 +211,9 @@ extern void cluster_unintern (struct cluster_list *);
/* Transit attribute prototypes. */
void transit_unintern (struct transit *);
-/* Exported for unit-test purposes only */
-extern bgp_attr_parse_ret_t bgp_mp_reach_parse (struct peer *, const bgp_size_t,
- struct attr *, const u_char, struct bgp_nlri *);
-extern bgp_attr_parse_ret_t bgp_mp_unreach_parse (struct peer *,
- const bgp_size_t, const u_char, struct bgp_nlri *, bool*);
+/* Below exported for unit-test purposes only
+ * */
+extern int bgp_mp_reach_parse (bgp_attr_parser_args args);
+extern int bgp_mp_unreach_parse (bgp_attr_parser_args args);
#endif /* _QUAGGA_BGP_ATTR_H */