tag | line | file | source code |
ax25 | 155 | include/net/sock.h | ax25_cb *ax25; |
ax25 | 164 | net/ax25/af_ax25.c | static void ax25_remove_socket(ax25_cb *ax25) |
ax25 | 172 | net/ax25/af_ax25.c | if ((s = ax25_list) == ax25) { |
ax25 | 179 | net/ax25/af_ax25.c | if (s->next == ax25) { |
ax25 | 180 | net/ax25/af_ax25.c | s->next = ax25->next; |
ax25 | 230 | net/ax25/af_ax25.c | static void ax25_insert_socket(ax25_cb *ax25) |
ax25 | 237 | net/ax25/af_ax25.c | ax25->next = ax25_list; |
ax25 | 238 | net/ax25/af_ax25.c | ax25_list = ax25; |
ax25 | 380 | net/ax25/af_ax25.c | void ax25_destroy_socket(ax25_cb *ax25) /* Not static as its used by the timer */ |
ax25 | 388 | net/ax25/af_ax25.c | del_timer(&ax25->timer); |
ax25 | 390 | net/ax25/af_ax25.c | ax25_remove_socket(ax25); |
ax25 | 391 | net/ax25/af_ax25.c | ax25_clear_tx_queue(ax25); /* Flush the send queue */ |
ax25 | 393 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 394 | net/ax25/af_ax25.c | while ((skb = skb_dequeue(&ax25->sk->receive_queue)) != NULL) { |
ax25 | 395 | net/ax25/af_ax25.c | if (skb->sk != ax25->sk) { /* A pending connection */ |
ax25 | 397 | net/ax25/af_ax25.c | ax25_set_timer(skb->sk->ax25); |
ax25 | 398 | net/ax25/af_ax25.c | skb->sk->ax25->state = AX25_STATE_0; |
ax25 | 405 | net/ax25/af_ax25.c | if (ax25->digipeat != NULL) { |
ax25 | 406 | net/ax25/af_ax25.c | kfree_s(ax25->digipeat, sizeof(ax25_digi)); |
ax25 | 407 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 410 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 411 | net/ax25/af_ax25.c | if (ax25->sk->wmem_alloc || ax25->sk->rmem_alloc) { /* Defer: outstanding buffers */ |
ax25 | 412 | net/ax25/af_ax25.c | init_timer(&ax25->timer); |
ax25 | 413 | net/ax25/af_ax25.c | ax25->timer.expires = 10 * HZ; |
ax25 | 414 | net/ax25/af_ax25.c | ax25->timer.function = ax25_destroy_timer; |
ax25 | 415 | net/ax25/af_ax25.c | ax25->timer.data = (unsigned long)ax25; |
ax25 | 416 | net/ax25/af_ax25.c | add_timer(&ax25->timer); |
ax25 | 418 | net/ax25/af_ax25.c | kfree_s(ax25->sk, sizeof(*ax25->sk)); |
ax25 | 419 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 422 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 499 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 501 | net/ax25/af_ax25.c | if ((ax25 = (ax25_cb *)kmalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL) |
ax25 | 504 | net/ax25/af_ax25.c | skb_queue_head_init(&ax25->write_queue); |
ax25 | 505 | net/ax25/af_ax25.c | skb_queue_head_init(&ax25->ack_queue); |
ax25 | 507 | net/ax25/af_ax25.c | init_timer(&ax25->timer); |
ax25 | 509 | net/ax25/af_ax25.c | ax25->rtt = DEFAULT_T1; |
ax25 | 510 | net/ax25/af_ax25.c | ax25->t1 = DEFAULT_T1; |
ax25 | 511 | net/ax25/af_ax25.c | ax25->t2 = DEFAULT_T2; |
ax25 | 512 | net/ax25/af_ax25.c | ax25->n2 = DEFAULT_N2; |
ax25 | 513 | net/ax25/af_ax25.c | ax25->t3 = DEFAULT_T3; |
ax25 | 515 | net/ax25/af_ax25.c | ax25->backoff = 1; |
ax25 | 516 | net/ax25/af_ax25.c | ax25->condition = 0x00; |
ax25 | 517 | net/ax25/af_ax25.c | ax25->t1timer = 0; |
ax25 | 518 | net/ax25/af_ax25.c | ax25->t2timer = 0; |
ax25 | 519 | net/ax25/af_ax25.c | ax25->t3timer = 0; |
ax25 | 520 | net/ax25/af_ax25.c | ax25->n2count = 0; |
ax25 | 522 | net/ax25/af_ax25.c | ax25->va = 0; |
ax25 | 523 | net/ax25/af_ax25.c | ax25->vr = 0; |
ax25 | 524 | net/ax25/af_ax25.c | ax25->vs = 0; |
ax25 | 526 | net/ax25/af_ax25.c | ax25->window = DEFAULT_WINDOW; |
ax25 | 527 | net/ax25/af_ax25.c | ax25->device = NULL; |
ax25 | 528 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 529 | net/ax25/af_ax25.c | ax25->sk = NULL; |
ax25 | 531 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_0; |
ax25 | 533 | net/ax25/af_ax25.c | memset(&ax25->dest_addr, '\0', sizeof(ax25_address)); |
ax25 | 534 | net/ax25/af_ax25.c | memset(&ax25->source_addr, '\0', sizeof(ax25_address)); |
ax25 | 536 | net/ax25/af_ax25.c | return ax25; |
ax25 | 542 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 550 | net/ax25/af_ax25.c | for (ax25 = ax25_list; ax25 != NULL; ax25 = ax25->next) { |
ax25 | 551 | net/ax25/af_ax25.c | if (ax25->sk != NULL && ax25->sk->type != SOCK_SEQPACKET) |
ax25 | 554 | net/ax25/af_ax25.c | if (ax25cmp(&ax25->source_addr, src) == 0 && ax25cmp(&ax25->dest_addr, dest) == 0 && ax25->device == dev) { |
ax25 | 555 | net/ax25/af_ax25.c | ax25_output(ax25, skb); |
ax25 | 560 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) |
ax25 | 563 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 565 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, src, sizeof(ax25_address)); |
ax25 | 566 | net/ax25/af_ax25.c | memcpy(&ax25->dest_addr, dest, sizeof(ax25_address)); |
ax25 | 569 | net/ax25/af_ax25.c | if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
ax25 | 570 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(ax25)); |
ax25 | 573 | net/ax25/af_ax25.c | memcpy(ax25->digipeat, digi, sizeof(ax25_digi)); |
ax25 | 576 | net/ax25/af_ax25.c | ax25_establish_data_link(ax25); |
ax25 | 577 | net/ax25/af_ax25.c | ax25_insert_socket(ax25); |
ax25 | 579 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_1; |
ax25 | 581 | net/ax25/af_ax25.c | ax25_set_timer(ax25); |
ax25 | 583 | net/ax25/af_ax25.c | ax25_output(ax25, skb); |
ax25 | 661 | net/ax25/af_ax25.c | sk->ax25->window = opt; |
ax25 | 667 | net/ax25/af_ax25.c | sk->ax25->rtt = (opt * PR_SLOWHZ) / 2; |
ax25 | 673 | net/ax25/af_ax25.c | sk->ax25->t2 = opt * PR_SLOWHZ; |
ax25 | 679 | net/ax25/af_ax25.c | sk->ax25->n2 = opt; |
ax25 | 685 | net/ax25/af_ax25.c | sk->ax25->t3 = opt * PR_SLOWHZ; |
ax25 | 689 | net/ax25/af_ax25.c | sk->ax25->backoff = opt ? 1 : 0; |
ax25 | 714 | net/ax25/af_ax25.c | val = sk->ax25->window; |
ax25 | 718 | net/ax25/af_ax25.c | val = sk->ax25->t1 / PR_SLOWHZ; |
ax25 | 722 | net/ax25/af_ax25.c | val = sk->ax25->t2 / PR_SLOWHZ; |
ax25 | 726 | net/ax25/af_ax25.c | val = sk->ax25->n2; |
ax25 | 730 | net/ax25/af_ax25.c | val = sk->ax25->t3 / PR_SLOWHZ; |
ax25 | 734 | net/ax25/af_ax25.c | val = sk->ax25->backoff; |
ax25 | 782 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 787 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 804 | net/ax25/af_ax25.c | kfree_s((void *)ax25, sizeof(*ax25)); |
ax25 | 844 | net/ax25/af_ax25.c | ax25->sk = sk; |
ax25 | 845 | net/ax25/af_ax25.c | sk->ax25 = ax25; |
ax25 | 853 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 858 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 874 | net/ax25/af_ax25.c | kfree_s((void *)ax25, sizeof(*ax25)); |
ax25 | 910 | net/ax25/af_ax25.c | ax25->backoff = osk->ax25->backoff; |
ax25 | 911 | net/ax25/af_ax25.c | ax25->rtt = osk->ax25->rtt; |
ax25 | 912 | net/ax25/af_ax25.c | ax25->t1 = osk->ax25->t1; |
ax25 | 913 | net/ax25/af_ax25.c | ax25->t2 = osk->ax25->t2; |
ax25 | 914 | net/ax25/af_ax25.c | ax25->t3 = osk->ax25->t3; |
ax25 | 915 | net/ax25/af_ax25.c | ax25->n2 = osk->ax25->n2; |
ax25 | 917 | net/ax25/af_ax25.c | ax25->window = osk->ax25->window; |
ax25 | 918 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 920 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, &osk->ax25->source_addr, sizeof(ax25_address)); |
ax25 | 922 | net/ax25/af_ax25.c | if (osk->ax25->digipeat != NULL) { |
ax25 | 923 | net/ax25/af_ax25.c | if ((ax25->digipeat = (ax25_digi *)kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
ax25 | 925 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 930 | net/ax25/af_ax25.c | sk->ax25 = ax25; |
ax25 | 931 | net/ax25/af_ax25.c | ax25->sk = sk; |
ax25 | 950 | net/ax25/af_ax25.c | switch (sk->ax25->state) { |
ax25 | 954 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 958 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DISC | PF, C_COMMAND); |
ax25 | 959 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_0; |
ax25 | 962 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 966 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DM | PF, C_RESPONSE); |
ax25 | 967 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_0; |
ax25 | 970 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 975 | net/ax25/af_ax25.c | ax25_clear_tx_queue(sk->ax25); |
ax25 | 976 | net/ax25/af_ax25.c | sk->ax25->n2count = 0; |
ax25 | 977 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DISC | PF, C_COMMAND); |
ax25 | 978 | net/ax25/af_ax25.c | sk->ax25->t3timer = 0; |
ax25 | 979 | net/ax25/af_ax25.c | sk->ax25->t1timer = sk->ax25->t1 = ax25_calculate_t1(sk->ax25); |
ax25 | 980 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_2; |
ax25 | 991 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 1033 | net/ax25/af_ax25.c | memcpy(&sk->ax25->source_addr, &addr->fsa_ax25.sax25_call, sizeof(ax25_address)); |
ax25 | 1035 | net/ax25/af_ax25.c | memcpy(&sk->ax25->source_addr, call, sizeof(ax25_address)); |
ax25 | 1051 | net/ax25/af_ax25.c | sk->ax25->device = dev; |
ax25 | 1052 | net/ax25/af_ax25.c | ax25_insert_socket(sk->ax25); |
ax25 | 1100 | net/ax25/af_ax25.c | if (sk->ax25->digipeat == NULL) { |
ax25 | 1101 | net/ax25/af_ax25.c | if ((sk->ax25->digipeat = (ax25_digi *)kmalloc(sizeof(ax25_digi), GFP_KERNEL)) == NULL) |
ax25 | 1105 | net/ax25/af_ax25.c | sk->ax25->digipeat->ndigi = ndigi; |
ax25 | 1108 | net/ax25/af_ax25.c | sk->ax25->digipeat->repeated[ct] = 0; |
ax25 | 1109 | net/ax25/af_ax25.c | memcpy(&sk->ax25->digipeat->calls[ct], &ap[ct], sizeof(ax25_address)); |
ax25 | 1113 | net/ax25/af_ax25.c | sk->ax25->digipeat->lastrepeat = 0; |
ax25 | 1121 | net/ax25/af_ax25.c | if ((err = ax25_rt_autobind(sk->ax25, &addr->sax25_call)) < 0) |
ax25 | 1123 | net/ax25/af_ax25.c | ax25_insert_socket(sk->ax25); /* Finish the bind */ |
ax25 | 1126 | net/ax25/af_ax25.c | if (sk->type == SOCK_SEQPACKET && ax25_find_cb(&sk->ax25->source_addr, &addr->sax25_call, sk->ax25->device) != NULL) |
ax25 | 1129 | net/ax25/af_ax25.c | memcpy(&sk->ax25->dest_addr, &addr->sax25_call, sizeof(ax25_address)); |
ax25 | 1141 | net/ax25/af_ax25.c | ax25_establish_data_link(sk->ax25); |
ax25 | 1142 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_1; |
ax25 | 1143 | net/ax25/af_ax25.c | ax25_set_timer(sk->ax25); /* Start going SABM SABM until a UA or a give up and DM */ |
ax25 | 1240 | net/ax25/af_ax25.c | addr = &sk->ax25->dest_addr; |
ax25 | 1242 | net/ax25/af_ax25.c | addr = &sk->ax25->source_addr; |
ax25 | 1251 | net/ax25/af_ax25.c | if (sk->ax25->digipeat != NULL) { |
ax25 | 1252 | net/ax25/af_ax25.c | ndigi = sk->ax25->digipeat->ndigi; |
ax25 | 1256 | net/ax25/af_ax25.c | memcpy(&sax->fsa_digipeater[i], &sk->ax25->digipeat->calls[i], sizeof(ax25_address)); |
ax25 | 1268 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 1389 | net/ax25/af_ax25.c | if ((ax25 = ax25_find_cb(&dest, &src, dev)) != NULL) { |
ax25 | 1395 | net/ax25/af_ax25.c | if (ax25_process_rx_frame(ax25, skb, type) == 0) |
ax25 | 1422 | net/ax25/af_ax25.c | ax25 = make->ax25; |
ax25 | 1438 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 1452 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, &dest, sizeof(ax25_address)); |
ax25 | 1453 | net/ax25/af_ax25.c | memcpy(&ax25->dest_addr, &src, sizeof(ax25_address)); |
ax25 | 1458 | net/ax25/af_ax25.c | if (dp.ndigi != 0 && ax25->digipeat == NULL && (ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
ax25 | 1460 | net/ax25/af_ax25.c | ax25_destroy_socket(ax25); |
ax25 | 1465 | net/ax25/af_ax25.c | if (ax25->digipeat != NULL) { |
ax25 | 1466 | net/ax25/af_ax25.c | kfree_s(ax25->digipeat, sizeof(ax25_digi)); |
ax25 | 1467 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 1471 | net/ax25/af_ax25.c | ax25_digi_invert(&dp, ax25->digipeat); |
ax25 | 1474 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 1476 | net/ax25/af_ax25.c | ax25_send_control(ax25, UA | PF, C_RESPONSE); |
ax25 | 1478 | net/ax25/af_ax25.c | ax25->t3timer = ax25->t3; |
ax25 | 1479 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_3; |
ax25 | 1481 | net/ax25/af_ax25.c | ax25_insert_socket(ax25); |
ax25 | 1483 | net/ax25/af_ax25.c | ax25_set_timer(ax25); |
ax25 | 1562 | net/ax25/af_ax25.c | if (sk->ax25->device == NULL) |
ax25 | 1597 | net/ax25/af_ax25.c | if (sk->type == SOCK_SEQPACKET && memcmp(&sk->ax25->dest_addr, &sax.sax25_call, sizeof(ax25_address)) != 0) |
ax25 | 1609 | net/ax25/af_ax25.c | memcpy(&sax.sax25_call, &sk->ax25->dest_addr, sizeof(ax25_address)); |
ax25 | 1610 | net/ax25/af_ax25.c | dp = sk->ax25->digipeat; |
ax25 | 1652 | net/ax25/af_ax25.c | ax25_output(sk->ax25, skb); /* Shove it onto the queue and kick */ |
ax25 | 1665 | net/ax25/af_ax25.c | asmptr += (lv = build_ax25_addr(asmptr, &sk->ax25->source_addr, &sax.sax25_call, dp, C_COMMAND)); |
ax25 | 1678 | net/ax25/af_ax25.c | ax25_queue_xmit(skb, sk->ax25->device, SOPRI_NORMAL); |
ax25 | 1868 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 1879 | net/ax25/af_ax25.c | for (ax25 = ax25_list; ax25 != NULL; ax25 = ax25->next) { |
ax25 | 1880 | net/ax25/af_ax25.c | if ((dev = ax25->device) == NULL) |
ax25 | 1886 | net/ax25/af_ax25.c | ax2asc(&ax25->dest_addr)); |
ax25 | 1888 | net/ax25/af_ax25.c | ax2asc(&ax25->source_addr), devname, |
ax25 | 1889 | net/ax25/af_ax25.c | ax25->state, |
ax25 | 1890 | net/ax25/af_ax25.c | ax25->vs, ax25->vr, ax25->va, |
ax25 | 1891 | net/ax25/af_ax25.c | ax25->t1timer / PR_SLOWHZ, |
ax25 | 1892 | net/ax25/af_ax25.c | ax25->t1 / PR_SLOWHZ, |
ax25 | 1893 | net/ax25/af_ax25.c | ax25->t2timer / PR_SLOWHZ, |
ax25 | 1894 | net/ax25/af_ax25.c | ax25->t2 / PR_SLOWHZ, |
ax25 | 1895 | net/ax25/af_ax25.c | ax25->t3timer / PR_SLOWHZ, |
ax25 | 1896 | net/ax25/af_ax25.c | ax25->t3 / PR_SLOWHZ, |
ax25 | 1897 | net/ax25/af_ax25.c | ax25->n2count, ax25->n2, |
ax25 | 1898 | net/ax25/af_ax25.c | ax25->rtt / PR_SLOWHZ, |
ax25 | 1899 | net/ax25/af_ax25.c | ax25->window); |
ax25 | 1901 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 1903 | net/ax25/af_ax25.c | ax25->sk->wmem_alloc, |
ax25 | 1904 | net/ax25/af_ax25.c | ax25->sk->rmem_alloc); |
ax25 | 60 | net/ax25/ax25_in.c | static int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb) |
ax25 | 70 | net/ax25/ax25_in.c | queued = nr_route_frame(skb, ax25); |
ax25 | 75 | net/ax25/ax25_in.c | ax25_ip_mode_set(&ax25->dest_addr, ax25->device, 'V'); |
ax25 | 83 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 84 | net/ax25/ax25_in.c | if (sock_queue_rcv_skb(ax25->sk, skb) == 0) { |
ax25 | 87 | net/ax25/ax25_in.c | ax25->condition |= OWN_RX_BUSY_CONDITION; |
ax25 | 104 | net/ax25/ax25_in.c | static int ax25_state1_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int type) |
ax25 | 110 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 114 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | pf, C_RESPONSE); |
ax25 | 119 | net/ax25/ax25_in.c | ax25_calculate_rtt(ax25); |
ax25 | 120 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 121 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 122 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 123 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 124 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 125 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 126 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 127 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 128 | net/ax25/ax25_in.c | ax25->sk->state = TCP_ESTABLISHED; |
ax25 | 130 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 131 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 138 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 139 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 140 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 141 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 142 | net/ax25/ax25_in.c | ax25->sk->err = ECONNREFUSED; |
ax25 | 143 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 144 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 145 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 162 | net/ax25/ax25_in.c | static int ax25_state2_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int type) |
ax25 | 168 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | pf, C_RESPONSE); |
ax25 | 172 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 177 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 178 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 179 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 180 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 181 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 182 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 183 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 190 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 191 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 192 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 193 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 194 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 195 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 196 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 206 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | PF, C_RESPONSE); |
ax25 | 221 | net/ax25/ax25_in.c | static int ax25_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int type) |
ax25 | 230 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 231 | net/ax25/ax25_in.c | ax25->condition = 0x00; |
ax25 | 232 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 233 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 234 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 235 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 236 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 240 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 241 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 242 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 243 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 244 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 245 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 246 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 247 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 248 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 249 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 254 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 255 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 259 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 260 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 261 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 262 | net/ax25/ax25_in.c | if (ax25->sk) { |
ax25 | 263 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 264 | net/ax25/ax25_in.c | ax25->sk->err = ECONNRESET; |
ax25 | 265 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 266 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 267 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 272 | net/ax25/ax25_in.c | ax25->condition |= PEER_RX_BUSY_CONDITION; |
ax25 | 273 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 274 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 275 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 277 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 278 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 283 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 284 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 285 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 286 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 288 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 289 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 294 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 295 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 296 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 297 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 298 | net/ax25/ax25_in.c | ax25_calculate_rtt(ax25); |
ax25 | 299 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 300 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 302 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 303 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 310 | net/ax25/ax25_in.c | if (!ax25_validate_nr(ax25, nr)) { |
ax25 | 311 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 312 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 315 | net/ax25/ax25_in.c | if (ax25->condition & PEER_RX_BUSY_CONDITION) { |
ax25 | 316 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 318 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 320 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 321 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 324 | net/ax25/ax25_in.c | if (ns == ax25->vr) { |
ax25 | 325 | net/ax25/ax25_in.c | queued = ax25_rx_iframe(ax25, skb); |
ax25 | 326 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 327 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 330 | net/ax25/ax25_in.c | ax25->vr = (ax25->vr + 1) % MODULUS; |
ax25 | 331 | net/ax25/ax25_in.c | ax25->condition &= ~REJECT_CONDITION; |
ax25 | 333 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 335 | net/ax25/ax25_in.c | if (!(ax25->condition & ACK_PENDING_CONDITION)) { |
ax25 | 336 | net/ax25/ax25_in.c | ax25->t2timer = ax25->t2; |
ax25 | 337 | net/ax25/ax25_in.c | ax25->condition |= ACK_PENDING_CONDITION; |
ax25 | 341 | net/ax25/ax25_in.c | if (ax25->condition & REJECT_CONDITION) { |
ax25 | 342 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 344 | net/ax25/ax25_in.c | ax25->condition |= REJECT_CONDITION; |
ax25 | 345 | net/ax25/ax25_in.c | ax25_send_control(ax25, REJ | pf, C_RESPONSE); |
ax25 | 346 | net/ax25/ax25_in.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 353 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 354 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 369 | net/ax25/ax25_in.c | static int ax25_state4_machine(ax25_cb *ax25, struct sk_buff *skb, int frametype, int type) |
ax25 | 378 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 379 | net/ax25/ax25_in.c | ax25->condition = 0x00; |
ax25 | 380 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 381 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 382 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 383 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 384 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 385 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 386 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 390 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 391 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 392 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 393 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 394 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 395 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 396 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 397 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 398 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 399 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 404 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 405 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 409 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 410 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 411 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 412 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 413 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 414 | net/ax25/ax25_in.c | ax25->sk->err = ECONNRESET; |
ax25 | 415 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 416 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 417 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 422 | net/ax25/ax25_in.c | ax25->condition |= PEER_RX_BUSY_CONDITION; |
ax25 | 424 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 425 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 426 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 427 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 428 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 429 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 430 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 433 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 434 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 439 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 440 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 441 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 443 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 444 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 449 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 451 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 452 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 453 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 454 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 455 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 456 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 457 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 460 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 461 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 466 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 467 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 468 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 470 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 471 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 476 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 478 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 479 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 480 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 481 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 482 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 483 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 484 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 487 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 488 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 493 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 494 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 495 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 497 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 498 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 505 | net/ax25/ax25_in.c | if (!ax25_validate_nr(ax25, nr)) { |
ax25 | 506 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 507 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 510 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 511 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 512 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 515 | net/ax25/ax25_in.c | if (ns == ax25->vr) { |
ax25 | 516 | net/ax25/ax25_in.c | queued = ax25_rx_iframe(ax25, skb); |
ax25 | 517 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 518 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 521 | net/ax25/ax25_in.c | ax25->vr = (ax25->vr + 1) % MODULUS; |
ax25 | 522 | net/ax25/ax25_in.c | ax25->condition &= ~REJECT_CONDITION; |
ax25 | 524 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 526 | net/ax25/ax25_in.c | if (!(ax25->condition & ACK_PENDING_CONDITION)) { |
ax25 | 527 | net/ax25/ax25_in.c | ax25->t2timer = ax25->t2; |
ax25 | 528 | net/ax25/ax25_in.c | ax25->condition |= ACK_PENDING_CONDITION; |
ax25 | 532 | net/ax25/ax25_in.c | if (ax25->condition & REJECT_CONDITION) { |
ax25 | 533 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 535 | net/ax25/ax25_in.c | ax25->condition |= REJECT_CONDITION; |
ax25 | 536 | net/ax25/ax25_in.c | ax25_send_control(ax25, REJ | pf, C_RESPONSE); |
ax25 | 537 | net/ax25/ax25_in.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 544 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 545 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 558 | net/ax25/ax25_in.c | int ax25_process_rx_frame(ax25_cb *ax25, struct sk_buff *skb, int type) |
ax25 | 562 | net/ax25/ax25_in.c | if (ax25->state != AX25_STATE_1 && ax25->state != AX25_STATE_2 && |
ax25 | 563 | net/ax25/ax25_in.c | ax25->state != AX25_STATE_3 && ax25->state != AX25_STATE_4) { |
ax25 | 564 | net/ax25/ax25_in.c | printk("ax25_process_rx_frame: frame received - state = %d\n", ax25->state); |
ax25 | 568 | net/ax25/ax25_in.c | del_timer(&ax25->timer); |
ax25 | 572 | net/ax25/ax25_in.c | switch (ax25->state) { |
ax25 | 574 | net/ax25/ax25_in.c | queued = ax25_state1_machine(ax25, skb, frametype, type); |
ax25 | 577 | net/ax25/ax25_in.c | queued = ax25_state2_machine(ax25, skb, frametype, type); |
ax25 | 580 | net/ax25/ax25_in.c | queued = ax25_state3_machine(ax25, skb, frametype, type); |
ax25 | 583 | net/ax25/ax25_in.c | queued = ax25_state4_machine(ax25, skb, frametype, type); |
ax25 | 587 | net/ax25/ax25_in.c | ax25_set_timer(ax25); |
ax25 | 50 | net/ax25/ax25_out.c | int ax25_output(ax25_cb *ax25, struct sk_buff *skb) |
ax25 | 52 | net/ax25/ax25_out.c | skb_queue_tail(&ax25->write_queue, skb); /* Throw it on the queue */ |
ax25 | 54 | net/ax25/ax25_out.c | if (ax25->state == AX25_STATE_3 || ax25->state == AX25_STATE_4) |
ax25 | 55 | net/ax25/ax25_out.c | ax25_kick(ax25); |
ax25 | 64 | net/ax25/ax25_out.c | static void ax25_send_iframe(ax25_cb *ax25, struct sk_buff *skb, int poll_bit) |
ax25 | 75 | net/ax25/ax25_out.c | *frame |= (ax25->vr << 5); |
ax25 | 76 | net/ax25/ax25_out.c | *frame |= (ax25->vs << 1); |
ax25 | 78 | net/ax25/ax25_out.c | ax25_transmit_buffer(ax25, skb, C_COMMAND); |
ax25 | 81 | net/ax25/ax25_out.c | void ax25_kick(ax25_cb *ax25) |
ax25 | 87 | net/ax25/ax25_out.c | del_timer(&ax25->timer); |
ax25 | 89 | net/ax25/ax25_out.c | start = (skb_peek(&ax25->ack_queue) == NULL) ? ax25->va : ax25->vs; |
ax25 | 90 | net/ax25/ax25_out.c | end = (ax25->va + ax25->window) % MODULUS; |
ax25 | 92 | net/ax25/ax25_out.c | if (!(ax25->condition & PEER_RX_BUSY_CONDITION) && |
ax25 | 94 | net/ax25/ax25_out.c | skb_peek(&ax25->write_queue) != NULL) { |
ax25 | 96 | net/ax25/ax25_out.c | ax25->vs = start; |
ax25 | 107 | net/ax25/ax25_out.c | skb = skb_dequeue(&ax25->write_queue); |
ax25 | 110 | net/ax25/ax25_out.c | skb_queue_head(&ax25->write_queue, skb); |
ax25 | 114 | net/ax25/ax25_out.c | next = (ax25->vs + 1) % MODULUS; |
ax25 | 116 | net/ax25/ax25_out.c | last = (next == end) || skb_peek(&ax25->write_queue) == NULL; |
ax25 | 123 | net/ax25/ax25_out.c | ax25_send_iframe(ax25, skbn, (last) ? PF : 0); |
ax25 | 125 | net/ax25/ax25_out.c | ax25->vs = next; |
ax25 | 130 | net/ax25/ax25_out.c | skb_queue_tail(&ax25->ack_queue, skb); |
ax25 | 134 | net/ax25/ax25_out.c | } while (!last && skb_peek(&ax25->write_queue) != NULL); |
ax25 | 136 | net/ax25/ax25_out.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 138 | net/ax25/ax25_out.c | if (ax25->t1timer == 0) { |
ax25 | 139 | net/ax25/ax25_out.c | ax25->t3timer = 0; |
ax25 | 140 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 144 | net/ax25/ax25_out.c | ax25_set_timer(ax25); |
ax25 | 147 | net/ax25/ax25_out.c | void ax25_transmit_buffer(ax25_cb *ax25, struct sk_buff *skb, int type) |
ax25 | 151 | net/ax25/ax25_out.c | if (ax25->device == NULL) { |
ax25 | 152 | net/ax25/ax25_out.c | if (ax25->sk != NULL) { |
ax25 | 153 | net/ax25/ax25_out.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 154 | net/ax25/ax25_out.c | ax25->sk->err = ENETUNREACH; |
ax25 | 155 | net/ax25/ax25_out.c | if (!ax25->sk->dead) |
ax25 | 156 | net/ax25/ax25_out.c | ax25->sk->state_change(ax25->sk); |
ax25 | 157 | net/ax25/ax25_out.c | ax25->sk->dead = 1; |
ax25 | 162 | net/ax25/ax25_out.c | if (skb_headroom(skb) < size_ax25_addr(ax25->digipeat)) { |
ax25 | 169 | net/ax25/ax25_out.c | ptr = skb_push(skb, size_ax25_addr(ax25->digipeat)); |
ax25 | 170 | net/ax25/ax25_out.c | build_ax25_addr(ptr, &ax25->source_addr, &ax25->dest_addr, ax25->digipeat, type); |
ax25 | 174 | net/ax25/ax25_out.c | ax25_queue_xmit(skb, ax25->device, SOPRI_NORMAL); |
ax25 | 182 | net/ax25/ax25_out.c | void ax25_nr_error_recovery(ax25_cb *ax25) |
ax25 | 184 | net/ax25/ax25_out.c | ax25_establish_data_link(ax25); |
ax25 | 187 | net/ax25/ax25_out.c | void ax25_establish_data_link(ax25_cb *ax25) |
ax25 | 189 | net/ax25/ax25_out.c | ax25->condition = 0x00; |
ax25 | 190 | net/ax25/ax25_out.c | ax25->n2count = 0; |
ax25 | 192 | net/ax25/ax25_out.c | ax25_send_control(ax25, SABM | PF, C_COMMAND); |
ax25 | 194 | net/ax25/ax25_out.c | ax25->t3timer = 0; |
ax25 | 195 | net/ax25/ax25_out.c | ax25->t2timer = 0; |
ax25 | 196 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 199 | net/ax25/ax25_out.c | void ax25_transmit_enquiry(ax25_cb *ax25) |
ax25 | 201 | net/ax25/ax25_out.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) |
ax25 | 202 | net/ax25/ax25_out.c | ax25_send_control(ax25, RNR | PF, C_COMMAND); |
ax25 | 204 | net/ax25/ax25_out.c | ax25_send_control(ax25, RR | PF, C_COMMAND); |
ax25 | 206 | net/ax25/ax25_out.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 208 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 211 | net/ax25/ax25_out.c | void ax25_enquiry_response(ax25_cb *ax25) |
ax25 | 213 | net/ax25/ax25_out.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) |
ax25 | 214 | net/ax25/ax25_out.c | ax25_send_control(ax25, RNR | PF, C_RESPONSE); |
ax25 | 216 | net/ax25/ax25_out.c | ax25_send_control(ax25, RR | PF, C_RESPONSE); |
ax25 | 218 | net/ax25/ax25_out.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 221 | net/ax25/ax25_out.c | void ax25_check_iframes_acked(ax25_cb *ax25, unsigned short nr) |
ax25 | 223 | net/ax25/ax25_out.c | if (ax25->vs == nr) { |
ax25 | 224 | net/ax25/ax25_out.c | ax25_frames_acked(ax25, nr); |
ax25 | 225 | net/ax25/ax25_out.c | ax25_calculate_rtt(ax25); |
ax25 | 226 | net/ax25/ax25_out.c | ax25->t1timer = 0; |
ax25 | 227 | net/ax25/ax25_out.c | ax25->t3timer = ax25->t3; |
ax25 | 229 | net/ax25/ax25_out.c | if (ax25->va != nr) { |
ax25 | 230 | net/ax25/ax25_out.c | ax25_frames_acked(ax25, nr); |
ax25 | 231 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 236 | net/ax25/ax25_out.c | void ax25_check_need_response(ax25_cb *ax25, int type, int pf) |
ax25 | 239 | net/ax25/ax25_out.c | ax25_enquiry_response(ax25); |
ax25 | 230 | net/ax25/ax25_route.c | int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) |
ax25 | 240 | net/ax25/ax25_route.c | if ((ax25->device = ax25_rt->dev) == NULL) |
ax25 | 245 | net/ax25/ax25_route.c | call = (ax25_address *)ax25->device->dev_addr; |
ax25 | 247 | net/ax25/ax25_route.c | memcpy(&ax25->source_addr, call, sizeof(ax25_address)); |
ax25 | 248 | net/ax25/ax25_route.c | if (ax25->sk != NULL) |
ax25 | 249 | net/ax25/ax25_route.c | ax25->sk->zapped = 0; |
ax25 | 54 | net/ax25/ax25_subr.c | void ax25_clear_tx_queue(ax25_cb *ax25) |
ax25 | 58 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->write_queue)) != NULL) { |
ax25 | 63 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { |
ax25 | 74 | net/ax25/ax25_subr.c | void ax25_frames_acked(ax25_cb *ax25, unsigned short nr) |
ax25 | 81 | net/ax25/ax25_subr.c | if (ax25->va != nr) { |
ax25 | 82 | net/ax25/ax25_subr.c | while (skb_peek(&ax25->ack_queue) != NULL && ax25->va != nr) { |
ax25 | 83 | net/ax25/ax25_subr.c | skb = skb_dequeue(&ax25->ack_queue); |
ax25 | 86 | net/ax25/ax25_subr.c | ax25->va = (ax25->va + 1) % MODULUS; |
ax25 | 95 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { |
ax25 | 97 | net/ax25/ax25_subr.c | skb_queue_head(&ax25->write_queue, skb); |
ax25 | 108 | net/ax25/ax25_subr.c | int ax25_validate_nr(ax25_cb *ax25, unsigned short nr) |
ax25 | 110 | net/ax25/ax25_subr.c | unsigned short vc = ax25->va; |
ax25 | 112 | net/ax25/ax25_subr.c | while (vc != ax25->vs) { |
ax25 | 117 | net/ax25/ax25_subr.c | if (nr == ax25->vs) return 1; |
ax25 | 141 | net/ax25/ax25_subr.c | void ax25_send_control(ax25_cb *ax25, int frametype, int type) |
ax25 | 147 | net/ax25/ax25_subr.c | if ((dev = ax25->device) == NULL) |
ax25 | 150 | net/ax25/ax25_subr.c | if ((skb = alloc_skb(AX25_BPQ_HEADER_LEN + size_ax25_addr(ax25->digipeat) + 1, GFP_ATOMIC)) == NULL) |
ax25 | 153 | net/ax25/ax25_subr.c | skb_reserve(skb, AX25_BPQ_HEADER_LEN + size_ax25_addr(ax25->digipeat)); |
ax25 | 155 | net/ax25/ax25_subr.c | if (ax25->sk != NULL) { |
ax25 | 156 | net/ax25/ax25_subr.c | skb->sk = ax25->sk; |
ax25 | 157 | net/ax25/ax25_subr.c | ax25->sk->wmem_alloc += skb->truesize; |
ax25 | 164 | net/ax25/ax25_subr.c | frametype |= (ax25->vr << 5); |
ax25 | 170 | net/ax25/ax25_subr.c | ax25_transmit_buffer(ax25, skb, type); |
ax25 | 215 | net/ax25/ax25_subr.c | unsigned short ax25_calculate_t1(ax25_cb *ax25) |
ax25 | 220 | net/ax25/ax25_subr.c | if (ax25->backoff) |
ax25 | 221 | net/ax25/ax25_subr.c | for (n = 0; n < ax25->n2count; n++) |
ax25 | 224 | net/ax25/ax25_subr.c | return t * ax25->rtt; |
ax25 | 226 | net/ax25/ax25_subr.c | return 2 * ax25->rtt; |
ax25 | 233 | net/ax25/ax25_subr.c | void ax25_calculate_rtt(ax25_cb *ax25) |
ax25 | 235 | net/ax25/ax25_subr.c | if (ax25->t1timer > 0 && ax25->n2count == 0) |
ax25 | 236 | net/ax25/ax25_subr.c | ax25->rtt = (9 * ax25->rtt + ax25->t1 - ax25->t1timer) / 10; |
ax25 | 239 | net/ax25/ax25_subr.c | if (ax25->rtt < 1 * PR_SLOWHZ) |
ax25 | 240 | net/ax25/ax25_subr.c | ax25->rtt = 1 * PR_SLOWHZ; |
ax25 | 53 | net/ax25/ax25_timer.c | void ax25_set_timer(ax25_cb *ax25) |
ax25 | 59 | net/ax25/ax25_timer.c | del_timer(&ax25->timer); |
ax25 | 62 | net/ax25/ax25_timer.c | ax25->timer.next = ax25->timer.prev = NULL; |
ax25 | 63 | net/ax25/ax25_timer.c | ax25->timer.data = (unsigned long)ax25; |
ax25 | 64 | net/ax25/ax25_timer.c | ax25->timer.function = &ax25_timer; |
ax25 | 66 | net/ax25/ax25_timer.c | ax25->timer.expires = 10; |
ax25 | 67 | net/ax25/ax25_timer.c | add_timer(&ax25->timer); |
ax25 | 70 | net/ax25/ax25_timer.c | static void ax25_reset_timer(ax25_cb *ax25) |
ax25 | 76 | net/ax25/ax25_timer.c | del_timer(&ax25->timer); |
ax25 | 79 | net/ax25/ax25_timer.c | ax25->timer.data = (unsigned long)ax25; |
ax25 | 80 | net/ax25/ax25_timer.c | ax25->timer.function = &ax25_timer; |
ax25 | 81 | net/ax25/ax25_timer.c | ax25->timer.expires = 10; |
ax25 | 82 | net/ax25/ax25_timer.c | add_timer(&ax25->timer); |
ax25 | 93 | net/ax25/ax25_timer.c | ax25_cb *ax25 = (ax25_cb *)param; |
ax25 | 95 | net/ax25/ax25_timer.c | switch (ax25->state) { |
ax25 | 99 | net/ax25/ax25_timer.c | if ((ax25->sk != NULL && ax25->sk->dead) || ax25->sk == NULL) { |
ax25 | 100 | net/ax25/ax25_timer.c | del_timer(&ax25->timer); |
ax25 | 101 | net/ax25/ax25_timer.c | ax25_destroy_socket(ax25); |
ax25 | 111 | net/ax25/ax25_timer.c | if (ax25->sk != NULL) { |
ax25 | 112 | net/ax25/ax25_timer.c | if (ax25->sk->rmem_alloc < (ax25->sk->rcvbuf / 2) && (ax25->condition & OWN_RX_BUSY_CONDITION)) { |
ax25 | 113 | net/ax25/ax25_timer.c | ax25->condition &= ~OWN_RX_BUSY_CONDITION; |
ax25 | 114 | net/ax25/ax25_timer.c | ax25_send_control(ax25, RR, C_RESPONSE); |
ax25 | 115 | net/ax25/ax25_timer.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 122 | net/ax25/ax25_timer.c | ax25_kick(ax25); |
ax25 | 129 | net/ax25/ax25_timer.c | if (ax25->t2timer > 0 && --ax25->t2timer == 0) { |
ax25 | 130 | net/ax25/ax25_timer.c | if (ax25->state == AX25_STATE_3 || ax25->state == AX25_STATE_4) { |
ax25 | 131 | net/ax25/ax25_timer.c | if (ax25->condition & ACK_PENDING_CONDITION) { |
ax25 | 132 | net/ax25/ax25_timer.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 133 | net/ax25/ax25_timer.c | ax25_enquiry_response(ax25); |
ax25 | 138 | net/ax25/ax25_timer.c | if (ax25->t3timer > 0 && --ax25->t3timer == 0) { |
ax25 | 139 | net/ax25/ax25_timer.c | if (ax25->state == AX25_STATE_3) { |
ax25 | 140 | net/ax25/ax25_timer.c | ax25->n2count = 0; |
ax25 | 141 | net/ax25/ax25_timer.c | ax25_transmit_enquiry(ax25); |
ax25 | 142 | net/ax25/ax25_timer.c | ax25->state = AX25_STATE_4; |
ax25 | 144 | net/ax25/ax25_timer.c | ax25->t3timer = ax25->t3; |
ax25 | 147 | net/ax25/ax25_timer.c | if (ax25->t1timer == 0 || --ax25->t1timer > 0) { |
ax25 | 148 | net/ax25/ax25_timer.c | ax25_reset_timer(ax25); |
ax25 | 152 | net/ax25/ax25_timer.c | switch (ax25->state) { |
ax25 | 154 | net/ax25/ax25_timer.c | if (ax25->n2count == ax25->n2) { |
ax25 | 156 | net/ax25/ax25_timer.c | nr_link_failed(&ax25->dest_addr, ax25->device); |
ax25 | 158 | net/ax25/ax25_timer.c | ax25_clear_tx_queue(ax25); |
ax25 | 159 | net/ax25/ax25_timer.c | ax25->state = AX25_STATE_0; |
ax25 | 160 | net/ax25/ax25_timer.c | if (ax25->sk != NULL) { |
ax25 | 161 | net/ax25/ax25_timer.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 162 | net/ax25/ax25_timer.c | ax25->sk->err = ETIMEDOUT; |
ax25 | 163 | net/ax25/ax25_timer.c | if (!ax25->sk->dead) |
ax25 | 164 | net/ax25/ax25_timer.c | ax25->sk->state_change(ax25->sk); |
ax25 | 165 | net/ax25/ax25_timer.c | ax25->sk->dead = 1; |
ax25 | 168 | net/ax25/ax25_timer.c | ax25->n2count++; |
ax25 | 169 | net/ax25/ax25_timer.c | ax25_send_control(ax25, SABM | PF, C_COMMAND); |
ax25 | 174 | net/ax25/ax25_timer.c | if (ax25->n2count == ax25->n2) { |
ax25 | 176 | net/ax25/ax25_timer.c | nr_link_failed(&ax25->dest_addr, ax25->device); |
ax25 | 178 | net/ax25/ax25_timer.c | ax25_clear_tx_queue(ax25); |
ax25 | 179 | net/ax25/ax25_timer.c | ax25->state = AX25_STATE_0; |
ax25 | 180 | net/ax25/ax25_timer.c | if (ax25->sk != NULL) { |
ax25 | 181 | net/ax25/ax25_timer.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 182 | net/ax25/ax25_timer.c | ax25->sk->err = ETIMEDOUT; |
ax25 | 183 | net/ax25/ax25_timer.c | if (!ax25->sk->dead) |
ax25 | 184 | net/ax25/ax25_timer.c | ax25->sk->state_change(ax25->sk); |
ax25 | 185 | net/ax25/ax25_timer.c | ax25->sk->dead = 1; |
ax25 | 188 | net/ax25/ax25_timer.c | ax25->n2count++; |
ax25 | 189 | net/ax25/ax25_timer.c | ax25_send_control(ax25, DISC | PF, C_COMMAND); |
ax25 | 194 | net/ax25/ax25_timer.c | ax25->n2count = 1; |
ax25 | 195 | net/ax25/ax25_timer.c | ax25_transmit_enquiry(ax25); |
ax25 | 196 | net/ax25/ax25_timer.c | ax25->state = AX25_STATE_4; |
ax25 | 200 | net/ax25/ax25_timer.c | if (ax25->n2count == ax25->n2) { |
ax25 | 202 | net/ax25/ax25_timer.c | nr_link_failed(&ax25->dest_addr, ax25->device); |
ax25 | 204 | net/ax25/ax25_timer.c | ax25_clear_tx_queue(ax25); |
ax25 | 205 | net/ax25/ax25_timer.c | ax25_send_control(ax25, DM | PF, C_RESPONSE); |
ax25 | 206 | net/ax25/ax25_timer.c | ax25->state = AX25_STATE_0; |
ax25 | 207 | net/ax25/ax25_timer.c | if (ax25->sk != NULL) { |
ax25 | 208 | net/ax25/ax25_timer.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 209 | net/ax25/ax25_timer.c | ax25->sk->err = ETIMEDOUT; |
ax25 | 210 | net/ax25/ax25_timer.c | if (!ax25->sk->dead) |
ax25 | 211 | net/ax25/ax25_timer.c | ax25->sk->state_change(ax25->sk); |
ax25 | 212 | net/ax25/ax25_timer.c | ax25->sk->dead = 1; |
ax25 | 215 | net/ax25/ax25_timer.c | ax25->n2count++; |
ax25 | 216 | net/ax25/ax25_timer.c | ax25_transmit_enquiry(ax25); |
ax25 | 221 | net/ax25/ax25_timer.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 223 | net/ax25/ax25_timer.c | ax25_set_timer(ax25); |
ax25 | 64 | net/netrom/nr_route.c | static int nr_add_node(ax25_address *nr, char *mnemonic, ax25_address *ax25, |
ax25 | 78 | net/netrom/nr_route.c | if (ax25cmp(ax25, &nr_neigh->callsign) == 0 && nr_neigh->dev == dev) |
ax25 | 88 | net/netrom/nr_route.c | memcpy(&nr_neigh->callsign, ax25, sizeof(ax25_address)); |
ax25 | 638 | net/netrom/nr_route.c | int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25) |
ax25 | 649 | net/netrom/nr_route.c | if (ax25 != NULL) |
ax25 | 650 | net/netrom/nr_route.c | nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat, ax25->device, 0, nr_default.obs_count); |