projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Since 7c47438 we can remove math.h.
[l2tpns.git]
/
bgp.h
diff --git
a/bgp.h
b/bgp.h
index
ae89b47
..
f8b52d6
100644
(file)
--- a/
bgp.h
+++ b/
bgp.h
@@
-1,5
+1,5
@@
/* BGPv4 (RFC1771) */
/* BGPv4 (RFC1771) */
-/* $Id: bgp.h,v 1.
3 2004/11/11 03:07:42
bodea Exp $ */
+/* $Id: bgp.h,v 1.
5 2005/06/04 15:42:35
bodea Exp $ */
#ifndef __BGP_H__
#define __BGP_H__
#ifndef __BGP_H__
#define __BGP_H__
@@
-17,8
+17,8
@@
struct bgp_header {
char marker[16];
struct bgp_header {
char marker[16];
- u
16
len;
- u
8
type;
+ u
int16_t
len;
+ u
int8_t
type;
} __attribute__ ((packed));
/* bgp_header.type */
} __attribute__ ((packed));
/* bgp_header.type */
@@
-33,33
+33,33
@@
struct bgp_packet {
} __attribute__ ((packed));
struct bgp_data_open {
} __attribute__ ((packed));
struct bgp_data_open {
- u
8
version;
+ u
int8_t
version;
#define BGP_VERSION 4
#define BGP_VERSION 4
- u
16
as;
- u
16
hold_time;
- u
32
identifier;
- u
8
opt_len;
+ u
int16_t
as;
+ u
int16_t
hold_time;
+ u
int32_t
identifier;
+ u
int8_t
opt_len;
#define BGP_DATA_OPEN_SIZE 10 /* size of struct excluding opt_params */
char opt_params[sizeof(((struct bgp_packet *)0)->data) - BGP_DATA_OPEN_SIZE]; /* variable */
} __attribute__ ((packed));
struct bgp_ip_prefix {
#define BGP_DATA_OPEN_SIZE 10 /* size of struct excluding opt_params */
char opt_params[sizeof(((struct bgp_packet *)0)->data) - BGP_DATA_OPEN_SIZE]; /* variable */
} __attribute__ ((packed));
struct bgp_ip_prefix {
- u
8
len;
- u
32
prefix; /* variable */
+ u
int8_t
len;
+ u
int32_t
prefix; /* variable */
} __attribute__ ((packed));
#define BGP_IP_PREFIX_SIZE(p) (1 + ((p).len / 8) + ((p).len % 8 != 0))
struct bgp_path_attr {
} __attribute__ ((packed));
#define BGP_IP_PREFIX_SIZE(p) (1 + ((p).len / 8) + ((p).len % 8 != 0))
struct bgp_path_attr {
- u
8
flags;
- u
8
code;
+ u
int8_t
flags;
+ u
int8_t
code;
union {
struct {
union {
struct {
- u
8
len;
+ u
int8_t
len;
char value[29]; /* semi-random size, adequate for l2tpns */
} __attribute__ ((packed)) s; /* short */
struct {
char value[29]; /* semi-random size, adequate for l2tpns */
} __attribute__ ((packed)) s; /* short */
struct {
- u
16
len;
+ u
int16_t
len;
char value[28];
} __attribute__ ((packed)) e; /* extended */
} data; /* variable */
char value[28];
} __attribute__ ((packed)) e; /* extended */
} data; /* variable */
@@
-95,8
+95,8
@@
struct bgp_path_attr {
#define BGP_COMMUNITY_NO_EXPORT_SUBCONFED 0xffffff03 /* don't advertise to any other AS */
struct bgp_data_notification {
#define BGP_COMMUNITY_NO_EXPORT_SUBCONFED 0xffffff03 /* don't advertise to any other AS */
struct bgp_data_notification {
- u
8
error_code;
- u
8
error_subcode;
+ u
int8_t
error_code;
+ u
int8_t
error_subcode;
char data[sizeof(((struct bgp_packet *)0)->data) - 2]; /* variable */
} __attribute__ ((packed));
char data[sizeof(((struct bgp_packet *)0)->data) - 2]; /* variable */
} __attribute__ ((packed));
@@
-173,6
+173,8
@@
struct bgp_peer {
int cli_flag; /* updates requested from CLI */
char *path_attrs; /* path attrs to send in UPDATE message */
int path_attr_len; /* length of path attrs */
int cli_flag; /* updates requested from CLI */
char *path_attrs; /* path attrs to send in UPDATE message */
int path_attr_len; /* length of path attrs */
+ uint32_t events; /* events to poll */
+ struct event_data edata; /* poll data */
};
/* bgp_peer.cli_flag */
};
/* bgp_peer.cli_flag */
@@
-185,15
+187,17
@@
extern int bgp_configured;
/* actions */
int bgp_setup(int as);
/* actions */
int bgp_setup(int as);
-int bgp_start(struct bgp_peer *peer, char *name, int as, int keepalive, int hold, int enable);
+int bgp_start(struct bgp_peer *peer, char *name, int as, int keepalive,
+ int hold, int enable);
+
void bgp_stop(struct bgp_peer *peer);
void bgp_halt(struct bgp_peer *peer);
int bgp_restart(struct bgp_peer *peer);
void bgp_stop(struct bgp_peer *peer);
void bgp_halt(struct bgp_peer *peer);
int bgp_restart(struct bgp_peer *peer);
-int bgp_add_route(in_addr_t ip, in
_addr_t mask
);
-int bgp_del_route(in_addr_t ip, in
_addr_t mask
);
+int bgp_add_route(in_addr_t ip, in
t prefixlen
);
+int bgp_del_route(in_addr_t ip, in
t prefixlen
);
void bgp_enable_routing(int enable);
void bgp_enable_routing(int enable);
-int bgp_se
lect_state(struct bgp_peer *peer
);
-int bgp_process(
struct bgp_peer *peer, int readable, int writable
);
+int bgp_se
t_poll(void
);
+int bgp_process(
uint32_t events[]
);
char const *bgp_state_str(enum bgp_state state);
extern char const *cvs_id_bgp;
char const *bgp_state_str(enum bgp_state state);
extern char const *cvs_id_bgp;