Index: bgpd/bgp_fsm.c =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgp_fsm.c,v retrieving revision 1.2 diff -u -r1.2 bgp_fsm.c --- bgpd/bgp_fsm.c 13 Aug 2003 00:32:49 -0000 1.2 +++ bgpd/bgp_fsm.c 11 Jan 2004 00:30:10 -0000 @@ -292,7 +292,7 @@ peer->synctime = time (NULL); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); BGP_TIMER_ON (peer->t_routeadv, bgp_routeadv_timer, peer->v_routeadv); @@ -307,6 +307,21 @@ peer->uptime = time (NULL); } +void +bgp_connection_stop (struct peer *peer) +{ + if (peer->fd_local >= 0) + { + close (peer->fd_local); + peer->fd_local = -1; + } + if (peer->fd_accept >= 0) + { + close (peer->fd_accept); + peer->fd_accept = -1; + } +} + /* Administrative BGP peer stop event. */ int bgp_stop (struct peer *peer) @@ -367,12 +382,8 @@ stream_reset (peer->work); stream_fifo_clean (peer->obuf); - /* Close of file descriptor. */ - if (peer->fd >= 0) - { - close (peer->fd); - peer->fd = -1; - } + /* Close of connections. */ + bgp_connection_stop (peer); /* Connection information. */ if (peer->su_local) @@ -386,7 +397,7 @@ XFREE (MTYPE_SOCKUNION, peer->su_remote); peer->su_remote = NULL; } - + /* Clear remote router-id. */ peer->remote_id.s_addr = 0; @@ -477,13 +488,13 @@ int bgp_connect_success (struct peer *peer) { - if (peer->fd < 0) + if (peer->fd_local < 0) { zlog_err ("bgp_connect_success peer's fd is negative value %d", - peer->fd); + peer->fd_local); return -1; } - BGP_READ_ON (peer->t_read, bgp_read, peer->fd); + BGP_READ_ON (peer->t_read, bgp_read, peer->fd_local); /* bgp_getsockname (peer); */ @@ -521,29 +532,29 @@ { case connect_error: if (BGP_DEBUG (fsm, FSM)) - plog_info (peer->log, "%s [FSM] Connect error", peer->host); + plog_info (peer->log, "%s [FSM] Connect error", peer->host); BGP_EVENT_ADD (peer, TCP_connection_open_failed); break; case connect_success: if (BGP_DEBUG (fsm, FSM)) - plog_info (peer->log, "%s [FSM] Connect immediately success", - peer->host); + plog_info (peer->log, "%s [FSM] Connect immediately success", + peer->host); BGP_EVENT_ADD (peer, TCP_connection_open); break; case connect_in_progress: /* To check nonblocking connect, we wait until socket is readable or writable. */ if (BGP_DEBUG (fsm, FSM)) - plog_info (peer->log, "%s [FSM] Non blocking connect waiting result", - peer->host); - if (peer->fd < 0) + plog_info (peer->log, "%s [FSM] Non blocking connect waiting result", + peer->host); + if (*peer->fd < 0) { zlog_err ("bgp_start peer's fd is negative value %d", - peer->fd); + *peer->fd); return -1; } - BGP_READ_ON (peer->t_read, bgp_read, peer->fd); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_READ_ON (peer->t_read, bgp_read, *peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); break; } return 0; Index: bgpd/bgp_network.c =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgp_network.c,v retrieving revision 1.3 diff -u -r1.3 bgp_network.c --- bgpd/bgp_network.c 23 Dec 2003 17:34:39 -0000 1.3 +++ bgpd/bgp_network.c 11 Jan 2004 00:30:10 -0000 @@ -46,7 +46,6 @@ int accept_sock; union sockunion su; struct peer *peer; - struct peer *peer1; struct bgp *bgp; char buf[SU_ADDRSTRLEN]; @@ -73,12 +72,12 @@ zlog_info ("[Event] BGP connection from host %s", inet_sutop (&su, buf)); /* Check remote IP address */ - peer1 = peer_lookup (bgp, &su); - if (! peer1 || peer1->status == Idle) + peer = peer_lookup (bgp, &su); + if (! peer || peer->status == Idle) { if (BGP_DEBUG (events, EVENTS)) { - if (! peer1) + if (! peer) zlog_info ("[Event] BGP connection IP address %s is not configured", inet_sutop (&su, buf)); else @@ -90,30 +89,13 @@ } /* In case of peer is EBGP, we should set TTL for this connection. */ - if (peer_sort (peer1) == BGP_PEER_EBGP) - sockopt_ttl (peer1->su.sa.sa_family, bgp_sock, peer1->ttl); + if (peer_sort (peer) == BGP_PEER_EBGP) + sockopt_ttl (peer->su.sa.sa_family, bgp_sock, peer->ttl); if (! bgp) - bgp = peer1->bgp; - - /* Make dummy peer until read Open packet. */ - if (BGP_DEBUG (events, EVENTS)) - zlog_info ("[Event] Make dummy peer structure until read Open packet"); - - { - char buf[SU_ADDRSTRLEN + 1]; + bgp = peer->bgp; - peer = peer_create_accept (bgp); - SET_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER); - peer->su = su; - peer->fd = bgp_sock; - peer->status = Active; - peer->local_id = peer1->local_id; - - /* Make peer's address string. */ - sockunion2str (&su, buf, SU_ADDRSTRLEN); - peer->host = strdup (buf); - } + peer->fd_accept = bgp_sock; BGP_EVENT_ADD (peer, TCP_connection_open); @@ -133,7 +115,7 @@ strncpy ((char *)&ifreq.ifr_name, peer->ifname, sizeof (ifreq.ifr_name)); - ret = setsockopt (peer->fd, SOL_SOCKET, SO_BINDTODEVICE, + ret = setsockopt (*peer->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifreq, sizeof (ifreq)); if (ret < 0) { @@ -207,12 +189,12 @@ if (! addr) return; - bgp_bind_address (peer->fd, addr); + bgp_bind_address (*peer->fd, addr); } /* Source is specified with IP address. */ if (peer->update_source) - sockunion_bind (peer->fd, peer->update_source, 0, peer->update_source); + sockunion_bind (*peer->fd, peer->update_source, 0, peer->update_source); } /* BGP try to connect to the peer. */ @@ -222,16 +204,16 @@ unsigned int ifindex = 0; /* Make socket for the peer. */ - peer->fd = sockunion_socket (&peer->su); - if (peer->fd < 0) + *peer->fd = sockunion_socket (&peer->su); + if (*peer->fd < 0) return -1; /* If we can get socket for the peer, adjest TTL and make connection. */ if (peer_sort (peer) == BGP_PEER_EBGP) - sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl); + sockopt_ttl (peer->su.sa.sa_family, *peer->fd, peer->ttl); - sockopt_reuseaddr (peer->fd); - sockopt_reuseport (peer->fd); + sockopt_reuseaddr (*peer->fd); + sockopt_reuseport (*peer->fd); /* Bind socket. */ bgp_bind (peer); @@ -246,10 +228,10 @@ if (BGP_DEBUG (events, EVENTS)) plog_info (peer->log, "%s [Event] Connect start to %s fd %d", - peer->host, peer->host, peer->fd); + peer->host, peer->host, *peer->fd); /* Connect to the remote peer. */ - return sockunion_connect (peer->fd, &peer->su, htons (peer->port), ifindex); + return sockunion_connect (*peer->fd, &peer->su, htons (peer->port), ifindex); } /* After TCP connection is established. Get local address and port. */ @@ -268,8 +250,8 @@ peer->su_remote = NULL; } - peer->su_local = sockunion_getsockname (peer->fd); - peer->su_remote = sockunion_getpeername (peer->fd); + peer->su_local = sockunion_getsockname (*peer->fd); + peer->su_remote = sockunion_getpeername (*peer->fd); bgp_nexthop_set (peer->su_local, peer->su_remote, &peer->nexthop, peer); } Index: bgpd/bgp_packet.c =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgp_packet.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 bgp_packet.c --- bgpd/bgp_packet.c 25 Mar 2003 02:37:13 -0000 1.1.1.2 +++ bgpd/bgp_packet.c 11 Jan 2004 00:30:11 -0000 @@ -133,7 +133,7 @@ /* Check file descriptor. */ slen = sizeof (status); - ret = getsockopt(peer->fd, SOL_SOCKET, SO_ERROR, (void *) &status, &slen); + ret = getsockopt(*peer->fd, SOL_SOCKET, SO_ERROR, (void *) &status, &slen); /* If getsockopt is fail, this is fatal error. */ if (ret < 0) @@ -394,7 +394,7 @@ /* Add packet to the peer. */ bgp_packet_add (peer, packet); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } void @@ -468,7 +468,7 @@ /* Add packet to the peer. */ bgp_packet_add (peer, packet); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } /* Get next packet to be written. */ @@ -574,7 +574,7 @@ writenum = stream_get_endp (s) - stream_get_getp (s); /* Call write() system call. */ - num = write (peer->fd, STREAM_PNT (s), writenum); + num = write (*peer->fd, STREAM_PNT (s), writenum); write_errno = errno; if (num <= 0) { @@ -644,7 +644,7 @@ } if (bgp_write_proceed (peer)) - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); return 0; } @@ -664,7 +664,7 @@ assert (stream_get_endp (s) >= BGP_HEADER_SIZE); /* I'm not sure fd is writable. */ - ret = writen (peer->fd, STREAM_DATA (s), stream_get_endp (s)); + ret = writen (*peer->fd, STREAM_DATA (s), stream_get_endp (s)); if (ret <= 0) { bgp_stop (peer); @@ -724,7 +724,7 @@ /* Add packet to the peer. */ bgp_packet_add (peer, s); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } /* Make open packet and send it to the peer. */ @@ -779,7 +779,7 @@ /* Add packet to the peer. */ bgp_packet_add (peer, s); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } /* Send BGP notify packet with data potion. */ @@ -980,7 +980,7 @@ /* Add packet to the peer. */ bgp_packet_add (peer, packet); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } /* Send capability message to the peer. */ @@ -1047,14 +1047,13 @@ zlog_info ("%s send message type %d, length (incl. header) %d", peer->host, BGP_MSG_CAPABILITY, length); - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); + BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd); } /* RFC1771 6.8 Connection collision detection. */ int -bgp_collision_detect (struct peer *new, struct in_addr remote_id) +bgp_collision_detect (struct peer *peer, struct in_addr remote_id) { - struct peer *peer; struct listnode *nn; struct bgp *bgp; @@ -1075,11 +1074,10 @@ { /* Under OpenConfirm status, local peer structure already hold remote router ID. */ - - if (peer != new - && (peer->status == OpenConfirm || peer->status == OpenSent) - && sockunion_same (&peer->su, &new->su)) - { + if ((peer->status == OpenConfirm) + && ( ntohl(peer->remote_id.s_addr) == ntohl(remote_id.s_addr) ) + ) + { /* 1. The BGP Identifier of the local system is compared to the BGP Identifier of the remote system (as specified in the OPEN message). */ @@ -1092,8 +1090,16 @@ already in the OpenConfirm state), and accepts BGP connection initiated by the remote system. */ - if (peer->fd >= 0) - bgp_notify_send (peer, BGP_NOTIFY_CEASE, 0); + if (peer->fd_local >= 0) + { + BGP_WRITE_OFF (peer->t_write); + BGP_READ_OFF (peer->t_read); + close (peer->fd_local); + } + peer->fd_local = -1; + peer->fd = &peer->fd_accept; + + BGP_READ_ON (peer->t_read, bgp_read, *peer->fd); return 1; } else @@ -1104,12 +1110,15 @@ existing one (the one that is already in the OpenConfirm state). */ - if (new->fd >= 0) - bgp_notify_send (new, BGP_NOTIFY_CEASE, 0); + if (peer->fd_accept >= 0) + { + close (peer->fd_accept); + peer->fd_accept = -1; + } return -1; } - } - } + } + } return 0; } @@ -1186,51 +1195,6 @@ if (ret < 0) return ret; - /* Hack part. */ - if (CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - { - if (ret == 0 && realpeer->status != Active - && realpeer->status != OpenSent - && realpeer->status != OpenConfirm) - { - if (BGP_DEBUG (events, EVENTS)) - zlog_info ("%s [Event] peer's status is %s close connection", - realpeer->host, LOOKUP (bgp_status_msg, peer->status)); - return -1; - } - - if (BGP_DEBUG (events, EVENTS)) - zlog_info ("%s [Event] Transfer temporary BGP peer to existing one", - peer->host); - - bgp_stop (realpeer); - - /* Transfer file descriptor. */ - realpeer->fd = peer->fd; - peer->fd = -1; - - /* Transfer input buffer. */ - stream_free (realpeer->ibuf); - realpeer->ibuf = peer->ibuf; - realpeer->packet_size = peer->packet_size; - peer->ibuf = NULL; - - /* Transfer status. */ - realpeer->status = peer->status; - bgp_stop (peer); - - /* peer pointer change. Open packet send to neighbor. */ - peer = realpeer; - bgp_open_send (peer); - if (peer->fd < 0) - { - zlog_err ("bgp_open_receive peer's fd is negative value %d", - peer->fd); - return -1; - } - BGP_READ_ON (peer->t_read, bgp_read, peer->fd); - } - /* remote router-id check. */ if (remote_id.s_addr == 0 || ntohl (remote_id.s_addr) >= 0xe0000000 @@ -2030,7 +1994,7 @@ return 0; /* Read packet from fd. */ - nbytes = stream_read_unblock (peer->ibuf, peer->fd, readsize); + nbytes = stream_read_unblock (peer->ibuf, *peer->fd, readsize); /* If read byte is smaller than zero then error occured. */ if (nbytes < 0) @@ -2049,7 +2013,7 @@ { if (BGP_DEBUG (events, EVENTS)) plog_info (peer->log, "%s [Event] BGP connection closed fd %d", - peer->host, peer->fd); + peer->host, *peer->fd); BGP_EVENT_ADD (peer, TCP_connection_closed); return -1; } @@ -2096,12 +2060,12 @@ } else { - if (peer->fd < 0) + if (*peer->fd < 0) { - zlog_err ("bgp_read peer's fd is negative value %d", peer->fd); + zlog_err ("bgp_read peer's fd is negative value %d", *peer->fd); return -1; } - BGP_READ_ON (peer->t_read, bgp_read, peer->fd); + BGP_READ_ON (peer->t_read, bgp_read, *peer->fd); } /* Read packet header to determine type of the packet */ Index: bgpd/bgp_route.c =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgp_route.c,v retrieving revision 1.9 diff -u -r1.9 bgp_route.c --- bgpd/bgp_route.c 3 Nov 2003 12:37:43 -0000 1.9 +++ bgpd/bgp_route.c 11 Jan 2004 00:30:14 -0000 @@ -4202,7 +4202,8 @@ vty_out (vty, " (inaccessible)"); else if (binfo->igpmetric) vty_out (vty, " (metric %d)", binfo->igpmetric); - vty_out (vty, " from %s", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN)); + vty_out (vty, " from %s", + sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN)); if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)) vty_out (vty, " (%s)", inet_ntoa (attr->originator_id)); else Index: bgpd/bgpd.c =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgpd.c,v retrieving revision 1.2 diff -u -r1.2 bgpd.c --- bgpd/bgpd.c 13 Aug 2003 00:32:50 -0000 1.2 +++ bgpd/bgpd.c 11 Jan 2004 00:30:16 -0000 @@ -504,11 +504,10 @@ return 0; } -/* Peer comparison function for sorting. */ static int peer_cmp (struct peer *p1, struct peer *p2) { - return sockunion_cmp (&p1->su, &p2->su); + return sockunion_cmp (&p1->su, &p2->su); } int @@ -684,8 +683,11 @@ peer = XMALLOC (MTYPE_BGP_PEER, sizeof (struct peer)); memset (peer, 0, sizeof (struct peer)); + peer->fd = &peer->fd_local; + /* Set default value. */ - peer->fd = -1; + peer->fd_local = -1; + peer->fd_accept = -1; peer->v_start = BGP_INIT_START_TIMER; peer->v_connect = BGP_DEFAULT_CONNECT_RETRY; peer->v_asorig = BGP_DEFAULT_ASORIGINATE; @@ -769,19 +771,6 @@ return peer; } -/* Make accept BGP peer. Called from bgp_accept (). */ -struct peer * -peer_create_accept (struct bgp *bgp) -{ - struct peer *peer; - - peer = peer_new (); - peer->bgp = bgp; - listnode_add_sort (bgp->peer, peer); - - return peer; -} - /* Change peer's AS number. */ void peer_as_change (struct peer *peer, as_t as) @@ -1810,9 +1799,8 @@ LIST_LOOP (bgp->peer, peer, nn) { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - return peer; + if (sockunion_same (&peer->su, su)) + return peer; } return NULL; } @@ -1831,27 +1819,25 @@ LIST_LOOP (bgp->peer, peer, nn) { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - { - if (peer->as == remote_as - && peer->remote_id.s_addr == remote_id->s_addr) - return peer; - if (peer->as == remote_as) - *as = 1; - } + if (sockunion_same (&peer->su, su)) + { + if (peer->as == remote_as + && peer->remote_id.s_addr == remote_id->s_addr) + return peer; + if (peer->as == remote_as) + *as = 1; + } } LIST_LOOP (bgp->peer, peer, nn) { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - { - if (peer->as == remote_as - && peer->remote_id.s_addr == 0) - return peer; - if (peer->as == remote_as) - *as = 1; - } + if (sockunion_same (&peer->su, su)) + { + if (peer->as == remote_as + && peer->remote_id.s_addr == 0) + return peer; + if (peer->as == remote_as) + *as = 1; + } } return NULL; } @@ -2278,22 +2264,24 @@ if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) { - if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP) - sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl); + if (*peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP) + sockopt_ttl (peer->su.sa.sa_family, *peer->fd, + peer->ttl); } else { group = peer->group; LIST_LOOP (group->peer, peer, nn) - { - if (peer_sort (peer) == BGP_PEER_IBGP) - continue; - - peer->ttl = group->conf->ttl; - - if (peer->fd >= 0) - sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl); - } + { + if (peer_sort (peer) == BGP_PEER_IBGP) + continue; + + peer->ttl = group->conf->ttl; + + if (*peer->fd >= 0) + sockopt_ttl (peer->su.sa.sa_family, + *peer->fd, peer->ttl); + } } return 0; } @@ -2314,22 +2302,24 @@ if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) { - if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP) - sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl); + if (*peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP) + sockopt_ttl (peer->su.sa.sa_family, + *peer->fd, peer->ttl); } else { group = peer->group; LIST_LOOP (group->peer, peer, nn) - { - if (peer_sort (peer) == BGP_PEER_IBGP) - continue; - - peer->ttl = 1; - - if (peer->fd >= 0) - sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl); - } + { + if (peer_sort (peer) == BGP_PEER_IBGP) + continue; + + peer->ttl = 1; + + if (*peer->fd >= 0) + sockopt_ttl (peer->su.sa.sa_family, + *peer->fd, peer->ttl); + } } return 0; } Index: bgpd/bgpd.h =================================================================== RCS file: /var/cvsroot/quagga/bgpd/bgpd.h,v retrieving revision 1.5 diff -u -r1.5 bgpd.h --- bgpd/bgpd.h 13 Aug 2003 00:32:50 -0000 1.5 +++ bgpd/bgpd.h 11 Jan 2004 00:30:16 -0000 @@ -256,27 +256,29 @@ 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 */ + int *fd; /* connection in use: -> local||accept */ + int ttl; /* TTL of TCP connection to the peer. */ + int fd_local; /* locally initiated connection */ + int fd_accept; /* remote initiated/accepted connection */ + 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; - struct zlog *log; - u_char version; /* Peer BGP version. */ + unsigned int ifindex; /* ifindex of the BGP connection. */ + char *ifname; /* bind interface name. */ + char *update_if; /* interface to send from */ + union sockunion *update_source; /* sockunion to send from */ + struct zlog *log; /* log socket */ + 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 */ + 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 */ /* Peer address family configuration. */ u_char afc[AFI_MAX][SAFI_MAX];