Index: bgpd.h =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgpd.h,v retrieving revision 1.10 diff -u -r1.10 bgpd.h --- bgpd.h 21 May 2004 09:31:30 -0000 1.10 +++ bgpd.h 15 Jun 2004 13:38:33 -0000 @@ -225,6 +225,43 @@ } usmap; }; +/* BGP peer connection */ +struct bgp_peer_conn +{ + /* Associated peer, not known until after state OpenConfirm */ + struct bgp_peer *peer; + + int fd; /* File descriptor */ + unsigned short port; /* Destination port for peer */ + char *host; /* Printable address of the peer. */ + union sockunion su; /* Sockunion address of the peer. */ + union sockunion *su_local; /* Sockunion of local address. */ + union sockunion *su_remote; /* Sockunion of remote address. */ + + time_t uptime; /* Last Up/Down time */ + time_t readtime; /* Last read time */ + time_t resettime; /* Last reset time */ + + /* XXX: are these needed? are they set anywhere? ifindex doesnt + * appear to be + */ + unsigned int ifindex; /* ifindex of the BGP connection. */ + char *ifname; /* bind interface name. */ + + /* Packet receive and send buffer. */ + struct stream *ibuf; + struct stream_fifo *obuf; + struct stream *work; + + /* Status of the peer. */ + int status; + int ostatus; + + /* threads */ + struct thread *t_read; + struct thread *t_write; +}; + /* BGP neighbor structure. */ struct peer { @@ -249,38 +286,20 @@ /* Local router ID. */ struct in_addr local_id; - - /* Packet receive and send buffer. */ - struct stream *ibuf; - struct stream_fifo *obuf; - struct stream *work; - - /* Status of the peer. */ - int status; - int ostatus; - - /* Peer information */ - int fd; /* File descriptor */ - int ttl; /* TTL of TCP connection to the peer. */ - char *desc; /* Description of the peer. */ - unsigned short port; /* Destination port for peer */ - char *host; /* Printable address of the peer. */ - union sockunion su; /* Sockunion address of the peer. */ - time_t uptime; /* Last Up/Down time */ - time_t readtime; /* Last read time */ - time_t resettime; /* Last reset time */ - unsigned int ifindex; /* ifindex of the BGP connection. */ - char *ifname; /* bind interface name. */ - char *update_if; - union sockunion *update_source; + /* Peer information */ + int ttl; /* TTL of TCP connection to the peer. */ + char *desc; /* Description of the peer. */ + char *update_if; /* interface to bind to */ + union sockunion *update_source; /* Address to bind to */ struct zlog *log; - u_char version; /* Peer BGP version. */ + u_char version; /* Peer BGP version. */ - union sockunion *su_local; /* Sockunion of local address. */ - union sockunion *su_remote; /* Sockunion of remote address. */ - int shared_network; /* Is this peer shared same network. */ - struct bgp_nexthop nexthop; /* Nexthop */ + struct bgp_peer_conn *conn; /* Active peer connection */ + list connections; /* List of connections for this peer */ + + int shared_network; /* Is this peer shared same network. */ + struct bgp_nexthop nexthop; /* Nexthop */ /* Peer address family configuration. */ u_char afc[AFI_MAX][SAFI_MAX]; @@ -387,8 +406,7 @@ u_int32_t v_routeadv; /* Threads. */ - struct thread *t_read; - struct thread *t_write; + struct thread *t_start; struct thread *t_connect; struct thread *t_holdtime;