コード例 #1
0
ファイル: bgp.c プロジェクト: i3149/bird
static void
bgp_hold_timeout(timer *t)
{
  struct bgp_conn *conn = t->data;

  DBG("BGP: Hold timeout\n");

  /* If there is something in input queue, we are probably congested
     and perhaps just not processed BGP packets in time. */

  if (sk_rx_ready(conn->sk) > 0)
    bgp_start_timer(conn->hold_timer, 10);
  else
    bgp_error(conn, 4, 0, NULL, 0);
}
コード例 #2
0
ファイル: bgp.c プロジェクト: rogerhu/dd-wrt
static void
bgp_graceful_close_conn(struct bgp_conn *conn, unsigned subcode)
{
    switch (conn->state)
    {
    case BS_IDLE:
    case BS_CLOSE:
        return;
    case BS_CONNECT:
    case BS_ACTIVE:
        bgp_conn_enter_idle_state(conn);
        return;
    case BS_OPENSENT:
    case BS_OPENCONFIRM:
    case BS_ESTABLISHED:
        bgp_error(conn, 6, subcode, NULL, 0);
        return;
    default:
        bug("bgp_graceful_close_conn: Unknown state %d", conn->state);
    }
}
コード例 #3
0
ファイル: bgp.c プロジェクト: rogerhu/dd-wrt
static void
bgp_hold_timeout(timer *t)
{
    struct bgp_conn *conn = t->data;
    struct bgp_proto *p = conn->bgp;

    DBG("BGP: Hold timeout\n");

    /* We are already closing the connection - just do hangup */
    if (conn->state == BS_CLOSE)
    {
        BGP_TRACE(D_EVENTS, "Connection stalled");
        bgp_conn_enter_idle_state(conn);
        return;
    }

    /* If there is something in input queue, we are probably congested
       and perhaps just not processed BGP packets in time. */

    if (sk_rx_ready(conn->sk) > 0)
        bgp_start_timer(conn->hold_timer, 10);
    else
        bgp_error(conn, 4, 0, NULL, 0);
}