tag | line | file | source code |
ax25 | 155 | include/net/sock.h | ax25_cb *ax25; |
ax25 | 159 | net/ax25/af_ax25.c | static void ax25_remove_socket(ax25_cb *ax25) |
ax25 | 167 | net/ax25/af_ax25.c | if ((s = ax25_list) == ax25) { |
ax25 | 174 | net/ax25/af_ax25.c | if (s->next == ax25) { |
ax25 | 175 | net/ax25/af_ax25.c | s->next = ax25->next; |
ax25 | 225 | net/ax25/af_ax25.c | static void ax25_insert_socket(ax25_cb *ax25) |
ax25 | 232 | net/ax25/af_ax25.c | ax25->next = ax25_list; |
ax25 | 233 | net/ax25/af_ax25.c | ax25_list = ax25; |
ax25 | 375 | net/ax25/af_ax25.c | void ax25_destroy_socket(ax25_cb *ax25) /* Not static as its used by the timer */ |
ax25 | 383 | net/ax25/af_ax25.c | del_timer(&ax25->timer); |
ax25 | 385 | net/ax25/af_ax25.c | ax25_remove_socket(ax25); |
ax25 | 386 | net/ax25/af_ax25.c | ax25_clear_tx_queue(ax25); /* Flush the send queue */ |
ax25 | 388 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 389 | net/ax25/af_ax25.c | while ((skb = skb_dequeue(&ax25->sk->receive_queue)) != NULL) { |
ax25 | 390 | net/ax25/af_ax25.c | if (skb->sk != ax25->sk) { /* A pending connection */ |
ax25 | 392 | net/ax25/af_ax25.c | ax25_set_timer(skb->sk->ax25); |
ax25 | 393 | net/ax25/af_ax25.c | skb->sk->ax25->state = AX25_STATE_0; |
ax25 | 400 | net/ax25/af_ax25.c | if (ax25->digipeat != NULL) { |
ax25 | 401 | net/ax25/af_ax25.c | kfree_s(ax25->digipeat, sizeof(ax25_digi)); |
ax25 | 402 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 405 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 406 | net/ax25/af_ax25.c | if (ax25->sk->wmem_alloc || ax25->sk->rmem_alloc) { /* Defer: outstanding buffers */ |
ax25 | 407 | net/ax25/af_ax25.c | init_timer(&ax25->timer); |
ax25 | 408 | net/ax25/af_ax25.c | ax25->timer.expires = 10 * HZ; |
ax25 | 409 | net/ax25/af_ax25.c | ax25->timer.function = ax25_destroy_timer; |
ax25 | 410 | net/ax25/af_ax25.c | ax25->timer.data = (unsigned long)ax25; |
ax25 | 411 | net/ax25/af_ax25.c | add_timer(&ax25->timer); |
ax25 | 413 | net/ax25/af_ax25.c | kfree_s(ax25->sk, sizeof(*ax25->sk)); |
ax25 | 414 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 417 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 494 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 496 | net/ax25/af_ax25.c | if ((ax25 = (ax25_cb *)kmalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL) |
ax25 | 499 | net/ax25/af_ax25.c | skb_queue_head_init(&ax25->write_queue); |
ax25 | 500 | net/ax25/af_ax25.c | skb_queue_head_init(&ax25->ack_queue); |
ax25 | 502 | net/ax25/af_ax25.c | init_timer(&ax25->timer); |
ax25 | 504 | net/ax25/af_ax25.c | ax25->rtt = DEFAULT_T1; |
ax25 | 505 | net/ax25/af_ax25.c | ax25->t1 = DEFAULT_T1; |
ax25 | 506 | net/ax25/af_ax25.c | ax25->t2 = DEFAULT_T2; |
ax25 | 507 | net/ax25/af_ax25.c | ax25->n2 = DEFAULT_N2; |
ax25 | 508 | net/ax25/af_ax25.c | ax25->t3 = DEFAULT_T3; |
ax25 | 510 | net/ax25/af_ax25.c | ax25->condition = 0x00; |
ax25 | 511 | net/ax25/af_ax25.c | ax25->t1timer = 0; |
ax25 | 512 | net/ax25/af_ax25.c | ax25->t2timer = 0; |
ax25 | 513 | net/ax25/af_ax25.c | ax25->t3timer = 0; |
ax25 | 514 | net/ax25/af_ax25.c | ax25->n2count = 0; |
ax25 | 516 | net/ax25/af_ax25.c | ax25->va = 0; |
ax25 | 517 | net/ax25/af_ax25.c | ax25->vr = 0; |
ax25 | 518 | net/ax25/af_ax25.c | ax25->vs = 0; |
ax25 | 520 | net/ax25/af_ax25.c | ax25->window = DEFAULT_WINDOW; |
ax25 | 521 | net/ax25/af_ax25.c | ax25->device = NULL; |
ax25 | 522 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 523 | net/ax25/af_ax25.c | ax25->sk = NULL; |
ax25 | 525 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_0; |
ax25 | 527 | net/ax25/af_ax25.c | memset(&ax25->dest_addr, '\0', sizeof(ax25_address)); |
ax25 | 528 | net/ax25/af_ax25.c | memset(&ax25->source_addr, '\0', sizeof(ax25_address)); |
ax25 | 530 | net/ax25/af_ax25.c | return ax25; |
ax25 | 535 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 545 | net/ax25/af_ax25.c | for (ax25 = ax25_list; ax25 != NULL; ax25 = ax25->next) { |
ax25 | 546 | net/ax25/af_ax25.c | if (ax25->sk != NULL && ax25->sk->type != SOCK_SEQPACKET) |
ax25 | 549 | net/ax25/af_ax25.c | if (ax25cmp(&ax25->source_addr, src) == 0 && ax25cmp(&ax25->dest_addr, dest) == 0 && ax25->device == dev) { |
ax25 | 550 | net/ax25/af_ax25.c | ax25_output(ax25, skb); |
ax25 | 555 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) |
ax25 | 558 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 560 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, src, sizeof(ax25_address)); |
ax25 | 561 | net/ax25/af_ax25.c | memcpy(&ax25->dest_addr, dest, sizeof(ax25_address)); |
ax25 | 563 | net/ax25/af_ax25.c | ax25_establish_data_link(ax25); |
ax25 | 564 | net/ax25/af_ax25.c | ax25_insert_socket(ax25); |
ax25 | 566 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_1; |
ax25 | 568 | net/ax25/af_ax25.c | ax25_set_timer(ax25); |
ax25 | 570 | net/ax25/af_ax25.c | ax25_output(ax25, skb); |
ax25 | 636 | net/ax25/af_ax25.c | sk->ax25->window = opt; |
ax25 | 642 | net/ax25/af_ax25.c | sk->ax25->t1 = opt * PR_SLOWHZ; |
ax25 | 648 | net/ax25/af_ax25.c | sk->ax25->t2 = opt * PR_SLOWHZ; |
ax25 | 654 | net/ax25/af_ax25.c | sk->ax25->n2 = opt; |
ax25 | 660 | net/ax25/af_ax25.c | sk->ax25->t3 = opt * PR_SLOWHZ; |
ax25 | 685 | net/ax25/af_ax25.c | val = sk->ax25->window; |
ax25 | 689 | net/ax25/af_ax25.c | val = sk->ax25->t1 / PR_SLOWHZ; |
ax25 | 693 | net/ax25/af_ax25.c | val = sk->ax25->t2 / PR_SLOWHZ; |
ax25 | 697 | net/ax25/af_ax25.c | val = sk->ax25->n2; |
ax25 | 701 | net/ax25/af_ax25.c | val = sk->ax25->t3 / PR_SLOWHZ; |
ax25 | 749 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 754 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 771 | net/ax25/af_ax25.c | kfree_s((void *)ax25, sizeof(*ax25)); |
ax25 | 811 | net/ax25/af_ax25.c | ax25->sk = sk; |
ax25 | 812 | net/ax25/af_ax25.c | sk->ax25 = ax25; |
ax25 | 820 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 825 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 841 | net/ax25/af_ax25.c | kfree_s((void *)ax25, sizeof(*ax25)); |
ax25 | 877 | net/ax25/af_ax25.c | ax25->rtt = osk->ax25->rtt; |
ax25 | 878 | net/ax25/af_ax25.c | ax25->t1 = osk->ax25->t1; |
ax25 | 879 | net/ax25/af_ax25.c | ax25->t2 = osk->ax25->t2; |
ax25 | 880 | net/ax25/af_ax25.c | ax25->t3 = osk->ax25->t3; |
ax25 | 881 | net/ax25/af_ax25.c | ax25->n2 = osk->ax25->n2; |
ax25 | 883 | net/ax25/af_ax25.c | ax25->window = osk->ax25->window; |
ax25 | 884 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 886 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, &osk->ax25->source_addr, sizeof(ax25_address)); |
ax25 | 888 | net/ax25/af_ax25.c | if (osk->ax25->digipeat != NULL) { |
ax25 | 889 | net/ax25/af_ax25.c | if ((ax25->digipeat = (ax25_digi *)kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
ax25 | 891 | net/ax25/af_ax25.c | kfree_s(ax25, sizeof(*ax25)); |
ax25 | 896 | net/ax25/af_ax25.c | sk->ax25 = ax25; |
ax25 | 897 | net/ax25/af_ax25.c | ax25->sk = sk; |
ax25 | 916 | net/ax25/af_ax25.c | switch (sk->ax25->state) { |
ax25 | 920 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 924 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DISC | PF, C_RESPONSE); |
ax25 | 925 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_0; |
ax25 | 928 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 932 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DM | PF, C_RESPONSE); |
ax25 | 933 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_0; |
ax25 | 936 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 941 | net/ax25/af_ax25.c | ax25_clear_tx_queue(sk->ax25); |
ax25 | 942 | net/ax25/af_ax25.c | sk->ax25->n2count = 0; |
ax25 | 943 | net/ax25/af_ax25.c | ax25_send_control(sk->ax25, DISC | PF, C_COMMAND); |
ax25 | 944 | net/ax25/af_ax25.c | sk->ax25->t3timer = 0; |
ax25 | 945 | net/ax25/af_ax25.c | sk->ax25->t1timer = sk->ax25->t1 = ax25_calculate_t1(sk->ax25); |
ax25 | 946 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_2; |
ax25 | 957 | net/ax25/af_ax25.c | ax25_destroy_socket(sk->ax25); |
ax25 | 999 | net/ax25/af_ax25.c | memcpy(&sk->ax25->source_addr, &addr->fsa_ax25.sax25_call, sizeof(ax25_address)); |
ax25 | 1001 | net/ax25/af_ax25.c | memcpy(&sk->ax25->source_addr, call, sizeof(ax25_address)); |
ax25 | 1017 | net/ax25/af_ax25.c | sk->ax25->device = dev; |
ax25 | 1018 | net/ax25/af_ax25.c | ax25_insert_socket(sk->ax25); |
ax25 | 1066 | net/ax25/af_ax25.c | if (sk->ax25->digipeat == NULL) { |
ax25 | 1067 | net/ax25/af_ax25.c | if ((sk->ax25->digipeat = (ax25_digi *)kmalloc(sizeof(ax25_digi), GFP_KERNEL)) == NULL) |
ax25 | 1071 | net/ax25/af_ax25.c | sk->ax25->digipeat->ndigi = ndigi; |
ax25 | 1074 | net/ax25/af_ax25.c | sk->ax25->digipeat->repeated[ct] = 0; |
ax25 | 1075 | net/ax25/af_ax25.c | memcpy(&sk->ax25->digipeat->calls[ct], &ap[ct], sizeof(ax25_address)); |
ax25 | 1079 | net/ax25/af_ax25.c | sk->ax25->digipeat->lastrepeat = 0; |
ax25 | 1087 | net/ax25/af_ax25.c | if ((err = ax25_rt_autobind(sk->ax25, &addr->sax25_call)) < 0) |
ax25 | 1089 | net/ax25/af_ax25.c | ax25_insert_socket(sk->ax25); /* Finish the bind */ |
ax25 | 1092 | 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 | 1095 | net/ax25/af_ax25.c | memcpy(&sk->ax25->dest_addr, &addr->sax25_call, sizeof(ax25_address)); |
ax25 | 1107 | net/ax25/af_ax25.c | ax25_establish_data_link(sk->ax25); |
ax25 | 1108 | net/ax25/af_ax25.c | sk->ax25->state = AX25_STATE_1; |
ax25 | 1109 | net/ax25/af_ax25.c | ax25_set_timer(sk->ax25); /* Start going SABM SABM until a UA or a give up and DM */ |
ax25 | 1206 | net/ax25/af_ax25.c | addr = &sk->ax25->dest_addr; |
ax25 | 1208 | net/ax25/af_ax25.c | addr = &sk->ax25->source_addr; |
ax25 | 1217 | net/ax25/af_ax25.c | if (sk->ax25->digipeat != NULL) { |
ax25 | 1218 | net/ax25/af_ax25.c | ndigi = sk->ax25->digipeat->ndigi; |
ax25 | 1222 | net/ax25/af_ax25.c | memcpy(&sax->fsa_digipeater[i], &sk->ax25->digipeat->calls[i], sizeof(ax25_address)); |
ax25 | 1235 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 1357 | net/ax25/af_ax25.c | if ((ax25 = ax25_find_cb(&dest, &src, dev)) != NULL) { |
ax25 | 1362 | net/ax25/af_ax25.c | if (ax25_process_rx_frame(ax25, skb, type) == 0) |
ax25 | 1389 | net/ax25/af_ax25.c | ax25 = make->ax25; |
ax25 | 1394 | net/ax25/af_ax25.c | if (dp.ndigi != 0 && ax25->digipeat == NULL && (ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
ax25 | 1396 | net/ax25/af_ax25.c | ax25_destroy_socket(ax25); |
ax25 | 1401 | net/ax25/af_ax25.c | if (ax25->digipeat != NULL) { |
ax25 | 1402 | net/ax25/af_ax25.c | kfree_s(ax25->digipeat, sizeof(ax25_digi)); |
ax25 | 1403 | net/ax25/af_ax25.c | ax25->digipeat = NULL; |
ax25 | 1407 | net/ax25/af_ax25.c | ax25_digi_invert(&dp, ax25->digipeat); |
ax25 | 1430 | net/ax25/af_ax25.c | if ((ax25 = ax25_create_cb()) == NULL) { |
ax25 | 1444 | net/ax25/af_ax25.c | memcpy(&ax25->source_addr, &dest, sizeof(ax25_address)); |
ax25 | 1445 | net/ax25/af_ax25.c | memcpy(&ax25->dest_addr, &src, sizeof(ax25_address)); |
ax25 | 1447 | net/ax25/af_ax25.c | ax25->device = dev; |
ax25 | 1449 | net/ax25/af_ax25.c | ax25_send_control(ax25, UA | PF, C_RESPONSE); |
ax25 | 1451 | net/ax25/af_ax25.c | ax25->t3timer = ax25->t3; |
ax25 | 1452 | net/ax25/af_ax25.c | ax25->state = AX25_STATE_3; |
ax25 | 1454 | net/ax25/af_ax25.c | ax25_insert_socket(ax25); |
ax25 | 1456 | net/ax25/af_ax25.c | ax25_set_timer(ax25); |
ax25 | 1495 | net/ax25/af_ax25.c | if (sk->ax25->device == NULL) |
ax25 | 1530 | net/ax25/af_ax25.c | if (sk->type == SOCK_SEQPACKET && memcmp(&sk->ax25->dest_addr, &sax.sax25_call, sizeof(ax25_address)) != 0) |
ax25 | 1542 | net/ax25/af_ax25.c | memcpy(&sax.sax25_call, &sk->ax25->dest_addr, sizeof(ax25_address)); |
ax25 | 1543 | net/ax25/af_ax25.c | dp = sk->ax25->digipeat; |
ax25 | 1573 | net/ax25/af_ax25.c | asmptr += (lv = build_ax25_addr(asmptr, &sk->ax25->source_addr, &sax.sax25_call, dp, C_COMMAND)); |
ax25 | 1596 | net/ax25/af_ax25.c | ax25_output(sk->ax25, skb); /* Shove it onto the queue and kick */ |
ax25 | 1600 | net/ax25/af_ax25.c | dev_queue_xmit(skb, sk->ax25->device, SOPRI_NORMAL); |
ax25 | 1784 | net/ax25/af_ax25.c | ax25_cb *ax25; |
ax25 | 1795 | net/ax25/af_ax25.c | for (ax25 = ax25_list; ax25 != NULL; ax25 = ax25->next) { |
ax25 | 1796 | net/ax25/af_ax25.c | if ((dev = ax25->device) == NULL) |
ax25 | 1802 | net/ax25/af_ax25.c | ax2asc(&ax25->dest_addr)); |
ax25 | 1804 | net/ax25/af_ax25.c | ax2asc(&ax25->source_addr), devname, |
ax25 | 1805 | net/ax25/af_ax25.c | ax25->state, |
ax25 | 1806 | net/ax25/af_ax25.c | ax25->vs, ax25->vr, ax25->va, |
ax25 | 1807 | net/ax25/af_ax25.c | ax25->t1timer / PR_SLOWHZ, |
ax25 | 1808 | net/ax25/af_ax25.c | ax25->t1 / PR_SLOWHZ, |
ax25 | 1809 | net/ax25/af_ax25.c | ax25->t2timer / PR_SLOWHZ, |
ax25 | 1810 | net/ax25/af_ax25.c | ax25->t2 / PR_SLOWHZ, |
ax25 | 1811 | net/ax25/af_ax25.c | ax25->t3timer / PR_SLOWHZ, |
ax25 | 1812 | net/ax25/af_ax25.c | ax25->t3 / PR_SLOWHZ, |
ax25 | 1813 | net/ax25/af_ax25.c | ax25->n2count, ax25->n2, |
ax25 | 1814 | net/ax25/af_ax25.c | ax25->rtt / PR_SLOWHZ, |
ax25 | 1815 | net/ax25/af_ax25.c | ax25->window); |
ax25 | 1817 | net/ax25/af_ax25.c | if (ax25->sk != NULL) { |
ax25 | 1819 | net/ax25/af_ax25.c | ax25->sk->wmem_alloc, |
ax25 | 1820 | 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, unsigned char *iframe) |
ax25 | 68 | net/ax25/ax25_in.c | if (ax25->digipeat == NULL) |
ax25 | 69 | net/ax25/ax25_in.c | queued = nr_route_frame(skb, ax25->device); |
ax25 | 74 | net/ax25/ax25_in.c | ax25_ip_mode_set(&ax25->dest_addr, ax25->device, 'V'); |
ax25 | 82 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 83 | net/ax25/ax25_in.c | if (sock_queue_rcv_skb(ax25->sk, skb) == 0) { |
ax25 | 86 | net/ax25/ax25_in.c | ax25->condition |= OWN_RX_BUSY_CONDITION; |
ax25 | 103 | net/ax25/ax25_in.c | static int ax25_state1_machine(ax25_cb *ax25, struct sk_buff *skb, unsigned char *frame, int frametype, int type) |
ax25 | 109 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 113 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | pf, C_RESPONSE); |
ax25 | 118 | net/ax25/ax25_in.c | ax25_calculate_rtt(ax25); |
ax25 | 119 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 120 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 121 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 122 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 123 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 124 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 125 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 126 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 127 | net/ax25/ax25_in.c | ax25->sk->state = TCP_ESTABLISHED; |
ax25 | 129 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 130 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 137 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 138 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 139 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 140 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 141 | net/ax25/ax25_in.c | ax25->sk->err = ECONNREFUSED; |
ax25 | 142 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 143 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 144 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 161 | net/ax25/ax25_in.c | static int ax25_state2_machine(ax25_cb *ax25, struct sk_buff *skb, unsigned char *frame, int frametype, int type) |
ax25 | 167 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | pf, C_RESPONSE); |
ax25 | 171 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 176 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 177 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 178 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 179 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 180 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 181 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 182 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 189 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 190 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 191 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 192 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 193 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 194 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 195 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 205 | net/ax25/ax25_in.c | ax25_send_control(ax25, DM | PF, C_RESPONSE); |
ax25 | 220 | net/ax25/ax25_in.c | static int ax25_state3_machine(ax25_cb *ax25, struct sk_buff *skb, unsigned char *frame, int frametype, int type) |
ax25 | 229 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 230 | net/ax25/ax25_in.c | ax25->condition = 0x00; |
ax25 | 231 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 232 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 233 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 234 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 235 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 239 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 240 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 241 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 242 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 243 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 244 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 245 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 246 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 247 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 248 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 253 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 254 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 258 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 259 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 260 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 261 | net/ax25/ax25_in.c | if (ax25->sk) { |
ax25 | 262 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 263 | net/ax25/ax25_in.c | ax25->sk->err = ECONNRESET; |
ax25 | 264 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 265 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 266 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 271 | net/ax25/ax25_in.c | ax25->condition |= PEER_RX_BUSY_CONDITION; |
ax25 | 272 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 273 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 274 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 276 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 277 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 282 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 283 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 284 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 285 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 287 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 288 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 293 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 294 | net/ax25/ax25_in.c | ax25_check_need_response(ax25, type, pf); |
ax25 | 295 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 296 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 297 | net/ax25/ax25_in.c | ax25_calculate_rtt(ax25); |
ax25 | 298 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 299 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 301 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 302 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 309 | net/ax25/ax25_in.c | if (!ax25_validate_nr(ax25, nr)) { |
ax25 | 310 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 311 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 314 | net/ax25/ax25_in.c | if (ax25->condition & PEER_RX_BUSY_CONDITION) { |
ax25 | 315 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 317 | net/ax25/ax25_in.c | ax25_check_iframes_acked(ax25, nr); |
ax25 | 319 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 320 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 323 | net/ax25/ax25_in.c | if (ns == ax25->vr) { |
ax25 | 324 | net/ax25/ax25_in.c | queued = ax25_rx_iframe(ax25, skb, frame); |
ax25 | 325 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 326 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 329 | net/ax25/ax25_in.c | ax25->vr = (ax25->vr + 1) % MODULUS; |
ax25 | 330 | net/ax25/ax25_in.c | ax25->condition &= ~REJECT_CONDITION; |
ax25 | 332 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 334 | net/ax25/ax25_in.c | if (!(ax25->condition & ACK_PENDING_CONDITION)) { |
ax25 | 335 | net/ax25/ax25_in.c | ax25->t2timer = ax25->t2; |
ax25 | 336 | net/ax25/ax25_in.c | ax25->condition |= ACK_PENDING_CONDITION; |
ax25 | 340 | net/ax25/ax25_in.c | if (ax25->condition & REJECT_CONDITION) { |
ax25 | 341 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 343 | net/ax25/ax25_in.c | ax25->condition |= REJECT_CONDITION; |
ax25 | 344 | net/ax25/ax25_in.c | ax25_send_control(ax25, REJ | pf, C_RESPONSE); |
ax25 | 345 | net/ax25/ax25_in.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 352 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 353 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 368 | net/ax25/ax25_in.c | static int ax25_state4_machine(ax25_cb *ax25, struct sk_buff *skb, unsigned char *frame, int frametype, int type) |
ax25 | 377 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 378 | net/ax25/ax25_in.c | ax25->condition = 0x00; |
ax25 | 379 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 380 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 381 | net/ax25/ax25_in.c | ax25->vs = 0; |
ax25 | 382 | net/ax25/ax25_in.c | ax25->va = 0; |
ax25 | 383 | net/ax25/ax25_in.c | ax25->vr = 0; |
ax25 | 384 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 385 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 389 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 390 | net/ax25/ax25_in.c | ax25_send_control(ax25, UA | pf, C_RESPONSE); |
ax25 | 391 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 392 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 393 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 394 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 395 | net/ax25/ax25_in.c | ax25->sk->err = 0; |
ax25 | 396 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 397 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 398 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 403 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 404 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 408 | net/ax25/ax25_in.c | ax25_clear_tx_queue(ax25); |
ax25 | 409 | net/ax25/ax25_in.c | ax25->t3timer = 0; |
ax25 | 410 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_0; |
ax25 | 411 | net/ax25/ax25_in.c | if (ax25->sk != NULL) { |
ax25 | 412 | net/ax25/ax25_in.c | ax25->sk->state = TCP_CLOSE; |
ax25 | 413 | net/ax25/ax25_in.c | ax25->sk->err = ECONNRESET; |
ax25 | 414 | net/ax25/ax25_in.c | if (!ax25->sk->dead) |
ax25 | 415 | net/ax25/ax25_in.c | ax25->sk->state_change(ax25->sk); |
ax25 | 416 | net/ax25/ax25_in.c | ax25->sk->dead = 1; |
ax25 | 421 | net/ax25/ax25_in.c | ax25->condition |= PEER_RX_BUSY_CONDITION; |
ax25 | 423 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 424 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 425 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 426 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 427 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 428 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 429 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 432 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 433 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 438 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 439 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 440 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 442 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 443 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 448 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 450 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 451 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 452 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 453 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 454 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 455 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 456 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 459 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 460 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 465 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 466 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 467 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 469 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 470 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 475 | net/ax25/ax25_in.c | ax25->condition &= ~PEER_RX_BUSY_CONDITION; |
ax25 | 477 | net/ax25/ax25_in.c | ax25->t1timer = 0; |
ax25 | 478 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 479 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 480 | net/ax25/ax25_in.c | if (ax25->vs == ax25->va) { |
ax25 | 481 | net/ax25/ax25_in.c | ax25->t3timer = ax25->t3; |
ax25 | 482 | net/ax25/ax25_in.c | ax25->n2count = 0; |
ax25 | 483 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_3; |
ax25 | 486 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 487 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 492 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 493 | net/ax25/ax25_in.c | if (ax25_validate_nr(ax25, nr)) { |
ax25 | 494 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 496 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 497 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 504 | net/ax25/ax25_in.c | if (!ax25_validate_nr(ax25, nr)) { |
ax25 | 505 | net/ax25/ax25_in.c | ax25_nr_error_recovery(ax25); |
ax25 | 506 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 509 | net/ax25/ax25_in.c | ax25_frames_acked(ax25, nr); |
ax25 | 510 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 511 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 514 | net/ax25/ax25_in.c | if (ns == ax25->vr) { |
ax25 | 515 | net/ax25/ax25_in.c | queued = ax25_rx_iframe(ax25, skb, frame); |
ax25 | 516 | net/ax25/ax25_in.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) { |
ax25 | 517 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 520 | net/ax25/ax25_in.c | ax25->vr = (ax25->vr + 1) % MODULUS; |
ax25 | 521 | net/ax25/ax25_in.c | ax25->condition &= ~REJECT_CONDITION; |
ax25 | 523 | net/ax25/ax25_in.c | ax25_enquiry_response(ax25); |
ax25 | 525 | net/ax25/ax25_in.c | if (!(ax25->condition & ACK_PENDING_CONDITION)) { |
ax25 | 526 | net/ax25/ax25_in.c | ax25->t2timer = ax25->t2; |
ax25 | 527 | net/ax25/ax25_in.c | ax25->condition |= ACK_PENDING_CONDITION; |
ax25 | 531 | net/ax25/ax25_in.c | if (ax25->condition & REJECT_CONDITION) { |
ax25 | 532 | net/ax25/ax25_in.c | if (pf) ax25_enquiry_response(ax25); |
ax25 | 534 | net/ax25/ax25_in.c | ax25->condition |= REJECT_CONDITION; |
ax25 | 535 | net/ax25/ax25_in.c | ax25_send_control(ax25, REJ | pf, C_RESPONSE); |
ax25 | 536 | net/ax25/ax25_in.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 543 | net/ax25/ax25_in.c | ax25_establish_data_link(ax25); |
ax25 | 544 | net/ax25/ax25_in.c | ax25->state = AX25_STATE_1; |
ax25 | 557 | 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 | del_timer(&ax25->timer); |
ax25 | 568 | net/ax25/ax25_in.c | switch (ax25->state) { |
ax25 | 570 | net/ax25/ax25_in.c | queued = ax25_state1_machine(ax25, skb, frame, frametype, type); |
ax25 | 573 | net/ax25/ax25_in.c | queued = ax25_state2_machine(ax25, skb, frame, frametype, type); |
ax25 | 576 | net/ax25/ax25_in.c | queued = ax25_state3_machine(ax25, skb, frame, frametype, type); |
ax25 | 579 | net/ax25/ax25_in.c | queued = ax25_state4_machine(ax25, skb, frame, frametype, type); |
ax25 | 582 | net/ax25/ax25_in.c | printk("ax25_process_rx_frame: frame received - state = %d\n", ax25->state); |
ax25 | 586 | 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 | 163 | net/ax25/ax25_out.c | ptr += build_ax25_addr(ptr, &ax25->source_addr, &ax25->dest_addr, ax25->digipeat, type); |
ax25 | 167 | net/ax25/ax25_out.c | dev_queue_xmit(skb, ax25->device, SOPRI_NORMAL); |
ax25 | 175 | net/ax25/ax25_out.c | void ax25_nr_error_recovery(ax25_cb *ax25) |
ax25 | 177 | net/ax25/ax25_out.c | ax25_establish_data_link(ax25); |
ax25 | 180 | net/ax25/ax25_out.c | void ax25_establish_data_link(ax25_cb *ax25) |
ax25 | 182 | net/ax25/ax25_out.c | ax25->condition = 0x00; |
ax25 | 183 | net/ax25/ax25_out.c | ax25->n2count = 0; |
ax25 | 185 | net/ax25/ax25_out.c | ax25_send_control(ax25, SABM | PF, C_COMMAND); |
ax25 | 187 | net/ax25/ax25_out.c | ax25->t3timer = 0; |
ax25 | 188 | net/ax25/ax25_out.c | ax25->t2timer = 0; |
ax25 | 189 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 192 | net/ax25/ax25_out.c | void ax25_transmit_enquiry(ax25_cb *ax25) |
ax25 | 194 | net/ax25/ax25_out.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) |
ax25 | 195 | net/ax25/ax25_out.c | ax25_send_control(ax25, RNR | PF, C_COMMAND); |
ax25 | 197 | net/ax25/ax25_out.c | ax25_send_control(ax25, RR | PF, C_COMMAND); |
ax25 | 199 | net/ax25/ax25_out.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 201 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 204 | net/ax25/ax25_out.c | void ax25_enquiry_response(ax25_cb *ax25) |
ax25 | 206 | net/ax25/ax25_out.c | if (ax25->condition & OWN_RX_BUSY_CONDITION) |
ax25 | 207 | net/ax25/ax25_out.c | ax25_send_control(ax25, RNR | PF, C_RESPONSE); |
ax25 | 209 | net/ax25/ax25_out.c | ax25_send_control(ax25, RR | PF, C_RESPONSE); |
ax25 | 211 | net/ax25/ax25_out.c | ax25->condition &= ~ACK_PENDING_CONDITION; |
ax25 | 214 | net/ax25/ax25_out.c | void ax25_check_iframes_acked(ax25_cb *ax25, unsigned short nr) |
ax25 | 216 | net/ax25/ax25_out.c | if (ax25->vs == nr) { |
ax25 | 217 | net/ax25/ax25_out.c | ax25_frames_acked(ax25, nr); |
ax25 | 218 | net/ax25/ax25_out.c | ax25_calculate_rtt(ax25); |
ax25 | 219 | net/ax25/ax25_out.c | ax25->t1timer = 0; |
ax25 | 220 | net/ax25/ax25_out.c | ax25->t3timer = ax25->t3; |
ax25 | 222 | net/ax25/ax25_out.c | if (ax25->va != nr) { |
ax25 | 223 | net/ax25/ax25_out.c | ax25_frames_acked(ax25, nr); |
ax25 | 224 | net/ax25/ax25_out.c | ax25->t1timer = ax25->t1 = ax25_calculate_t1(ax25); |
ax25 | 229 | net/ax25/ax25_out.c | void ax25_check_need_response(ax25_cb *ax25, int type, int pf) |
ax25 | 232 | 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 | 52 | net/ax25/ax25_subr.c | void ax25_clear_tx_queue(ax25_cb *ax25) |
ax25 | 56 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->write_queue)) != NULL) { |
ax25 | 61 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { |
ax25 | 72 | net/ax25/ax25_subr.c | void ax25_frames_acked(ax25_cb *ax25, unsigned short nr) |
ax25 | 79 | net/ax25/ax25_subr.c | if (ax25->va != nr) { |
ax25 | 80 | net/ax25/ax25_subr.c | while (skb_peek(&ax25->ack_queue) != NULL && ax25->va != nr) { |
ax25 | 81 | net/ax25/ax25_subr.c | skb = skb_dequeue(&ax25->ack_queue); |
ax25 | 84 | net/ax25/ax25_subr.c | ax25->va = (ax25->va + 1) % MODULUS; |
ax25 | 93 | net/ax25/ax25_subr.c | while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { |
ax25 | 95 | net/ax25/ax25_subr.c | skb_queue_head(&ax25->write_queue, skb); |
ax25 | 106 | net/ax25/ax25_subr.c | int ax25_validate_nr(ax25_cb *ax25, unsigned short nr) |
ax25 | 108 | net/ax25/ax25_subr.c | unsigned short vc = ax25->va; |
ax25 | 110 | net/ax25/ax25_subr.c | while (vc != ax25->vs) { |
ax25 | 115 | net/ax25/ax25_subr.c | if (nr == ax25->vs) return 1; |
ax25 | 139 | net/ax25/ax25_subr.c | void ax25_send_control(ax25_cb *ax25, int frametype, int type) |
ax25 | 146 | net/ax25/ax25_subr.c | if ((dev = ax25->device) == NULL) |
ax25 | 149 | net/ax25/ax25_subr.c | if ((skb = alloc_skb(16 + 1 + size_ax25_addr(ax25->digipeat), GFP_ATOMIC)) == NULL) |
ax25 | 152 | net/ax25/ax25_subr.c | if (ax25->sk != NULL) { |
ax25 | 153 | net/ax25/ax25_subr.c | skb->sk = ax25->sk; |
ax25 | 154 | net/ax25/ax25_subr.c | ax25->sk->wmem_alloc += skb->mem_len; |
ax25 | 159 | net/ax25/ax25_subr.c | dptr += 1 + size_ax25_addr(ax25->digipeat); /* KISS byte & 2 calls */ |
ax25 | 165 | net/ax25/ax25_subr.c | frametype |= (ax25->vr << 5); |
ax25 | 170 | net/ax25/ax25_subr.c | skb->len = len + size_ax25_addr(ax25->digipeat) + 1; |
ax25 | 172 | 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 | 219 | net/ax25/ax25_subr.c | for (t = 2, n = 0; n < ax25->n2count; n++) |
ax25 | 222 | net/ax25/ax25_subr.c | return t * ax25->rtt; |
ax25 | 228 | net/ax25/ax25_subr.c | void ax25_calculate_rtt(ax25_cb *ax25) |
ax25 | 230 | net/ax25/ax25_subr.c | if (ax25->n2count == 0) |
ax25 | 231 | net/ax25/ax25_subr.c | ax25->rtt = (9 * ax25->rtt + ax25->t1 - ax25->t1timer) / 10; |
ax25 | 234 | net/ax25/ax25_subr.c | if (ax25->rtt < 1 * PR_SLOWHZ) |
ax25 | 235 | 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 | 61 | net/netrom/nr_route.c | static int nr_add_node(ax25_address *nr, char *mnemonic, ax25_address *ax25, |
ax25 | 75 | net/netrom/nr_route.c | if (ax25cmp(ax25, &nr_neigh->callsign) == 0 && nr_neigh->dev == dev) |
ax25 | 85 | net/netrom/nr_route.c | memcpy(&nr_neigh->callsign, ax25, sizeof(ax25_address)); |