Revision 54e55169 proto/bgp/packets.c

View differences:

proto/bgp/packets.c
236 236
  buf[18] = type;
237 237
}
238 238

  
239
/**
240
 * bgp_fire_tx - transmit packets
241
 * @conn: connection
242
 *
243
 * Whenever the transmit buffers of the underlying TCP connection
244
 * are free and we have any packets queued for sending, the socket functions
245
 * call bgp_fire_tx() which takes care of selecting the highest priority packet
246
 * queued (Notification > Keepalive > Open > Update), assembling its header
247
 * and body and sending it to the connection.
248
 */
239 249
static int
240 250
bgp_fire_tx(struct bgp_conn *conn)
241 251
{
......
295 305
  return sk_send(sk, end - buf);
296 306
}
297 307

  
308
/**
309
 * bgp_schedule_packet - schedule a packet for transmission
310
 * @conn: connection
311
 * @type: packet type
312
 *
313
 * Schedule a packet of type @type to be sent as soon as possible.
314
 */
298 315
void
299 316
bgp_schedule_packet(struct bgp_conn *conn, int type)
300 317
{
......
770 787
    }
771 788
}
772 789

  
790
/**
791
 * bgp_rx_packet - handle a received packet
792
 * @conn: BGP connection
793
 * @pkt: start of the packet
794
 * @len: packet size
795
 *
796
 * bgp_rx_packet() takes a newly received packet and calls the corresponding
797
 * packet handler according to the packet type.
798
 */
773 799
static void
774 800
bgp_rx_packet(struct bgp_conn *conn, byte *pkt, unsigned len)
775 801
{
......
784 810
    }
785 811
}
786 812

  
813
/**
814
 * bgp_rx - handle received data
815
 * @sk: socket
816
 * @size: amount of data received
817
 *
818
 * bgp_rx() is called by the socket layer whenever new data arrive from
819
 * the underlying TCP connection. It assembles the data fragments to packets,
820
 * checks their headers and framing and passes complete packets to
821
 * bgp_rx_packet().
822
 */
787 823
int
788 824
bgp_rx(sock *sk, int size)
789 825
{

Also available in: Unified diff