^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Declarations of NET/ROM type objects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Jonathan Naylor G4KLX 9/4/95
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _NETROM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _NETROM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/netrom.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <net/sock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/refcount.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define NR_NETWORK_LEN 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define NR_TRANSPORT_LEN 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define NR_PROTO_IP 0x0C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define NR_PROTOEXT 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define NR_CONNREQ 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define NR_CONNACK 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define NR_DISCREQ 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define NR_DISCACK 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define NR_INFO 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define NR_INFOACK 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define NR_RESET 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define NR_CHOKE_FLAG 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define NR_NAK_FLAG 0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define NR_MORE_FLAG 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /* Define Link State constants. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) NR_STATE_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) NR_STATE_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) NR_STATE_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) NR_STATE_3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define NR_COND_ACK_PENDING 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define NR_COND_REJECT 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define NR_COND_PEER_RX_BUSY 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define NR_COND_OWN_RX_BUSY 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define NR_DEFAULT_T1 120000 /* Outstanding frames - 120 seconds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define NR_DEFAULT_T2 5000 /* Response delay - 5 seconds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define NR_DEFAULT_N2 3 /* Number of Retries - 3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #define NR_DEFAULT_T4 180000 /* Busy Delay - 180 seconds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define NR_DEFAULT_IDLE 0 /* No Activity Timeout - none */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define NR_DEFAULT_TTL 16 /* Default Time To Live - 16 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define NR_DEFAULT_ROUTING 1 /* Is routing enabled ? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define NR_DEFAULT_FAILS 2 /* Link fails until route fails */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define NR_DEFAULT_RESET 0 /* Sent / accept reset cmds? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define NR_MODULUS 256
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct nr_sock {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct sock sock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ax25_address user_addr, source_addr, dest_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) struct net_device *device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) unsigned char my_index, my_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) unsigned char your_index, your_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) unsigned char state, condition, bpqext, window;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) unsigned short vs, vr, va, vl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) unsigned char n2, n2count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) unsigned long t1, t2, t4, idle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) unsigned short fraglen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct timer_list t1timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct timer_list t2timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) struct timer_list t4timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) struct timer_list idletimer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) struct sk_buff_head ack_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) struct sk_buff_head reseq_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) struct sk_buff_head frag_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) #define nr_sk(sk) ((struct nr_sock *)(sk))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) struct nr_neigh {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) struct hlist_node neigh_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) ax25_address callsign;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) ax25_digi *digipeat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ax25_cb *ax25;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) unsigned char quality;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) unsigned char locked;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) unsigned short count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) unsigned int number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) unsigned char failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) refcount_t refcount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) struct nr_route {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) unsigned char quality;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) unsigned char obs_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct nr_neigh *neighbour;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) struct nr_node {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct hlist_node node_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ax25_address callsign;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) char mnemonic[7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) unsigned char which;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) unsigned char count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) struct nr_route routes[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) refcount_t refcount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) spinlock_t node_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) /*********************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) * nr_node & nr_neigh lists, refcounting and locking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) *********************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define nr_node_hold(__nr_node) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) refcount_inc(&((__nr_node)->refcount))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static __inline__ void nr_node_put(struct nr_node *nr_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) if (refcount_dec_and_test(&nr_node->refcount)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) kfree(nr_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) #define nr_neigh_hold(__nr_neigh) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) refcount_inc(&((__nr_neigh)->refcount))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) if (refcount_dec_and_test(&nr_neigh->refcount)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) if (nr_neigh->ax25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) ax25_cb_put(nr_neigh->ax25);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) kfree(nr_neigh->digipeat);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) kfree(nr_neigh);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) /* nr_node_lock and nr_node_unlock also hold/put the node's refcounter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) static __inline__ void nr_node_lock(struct nr_node *nr_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) nr_node_hold(nr_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) spin_lock_bh(&nr_node->node_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) static __inline__ void nr_node_unlock(struct nr_node *nr_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) spin_unlock_bh(&nr_node->node_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) nr_node_put(nr_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #define nr_neigh_for_each(__nr_neigh, list) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) hlist_for_each_entry(__nr_neigh, list, neigh_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #define nr_neigh_for_each_safe(__nr_neigh, node2, list) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) hlist_for_each_entry_safe(__nr_neigh, node2, list, neigh_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #define nr_node_for_each(__nr_node, list) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) hlist_for_each_entry(__nr_node, list, node_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #define nr_node_for_each_safe(__nr_node, node2, list) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) hlist_for_each_entry_safe(__nr_node, node2, list, node_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) /*********************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /* af_netrom.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) extern int sysctl_netrom_default_path_quality;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) extern int sysctl_netrom_obsolescence_count_initialiser;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) extern int sysctl_netrom_network_ttl_initialiser;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) extern int sysctl_netrom_transport_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) extern int sysctl_netrom_transport_maximum_tries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) extern int sysctl_netrom_transport_acknowledge_delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) extern int sysctl_netrom_transport_busy_delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) extern int sysctl_netrom_transport_requested_window_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) extern int sysctl_netrom_transport_no_activity_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) extern int sysctl_netrom_routing_control;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) extern int sysctl_netrom_link_fails_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) extern int sysctl_netrom_reset_circuit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) int nr_rx_frame(struct sk_buff *, struct net_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) void nr_destroy_socket(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) /* nr_dev.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) int nr_rx_ip(struct sk_buff *, struct net_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) void nr_setup(struct net_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) /* nr_in.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) int nr_process_rx_frame(struct sock *, struct sk_buff *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) /* nr_loopback.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) void nr_loopback_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) void nr_loopback_clear(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) int nr_loopback_queue(struct sk_buff *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) /* nr_out.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) void nr_output(struct sock *, struct sk_buff *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) void nr_send_nak_frame(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) void nr_kick(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) void nr_transmit_buffer(struct sock *, struct sk_buff *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) void nr_establish_data_link(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) void nr_enquiry_response(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) void nr_check_iframes_acked(struct sock *, unsigned short);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) /* nr_route.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) void nr_rt_device_down(struct net_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) struct net_device *nr_dev_first(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) struct net_device *nr_dev_get(ax25_address *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) int nr_rt_ioctl(unsigned int, void __user *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) void nr_link_failed(ax25_cb *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) int nr_route_frame(struct sk_buff *, ax25_cb *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) extern const struct seq_operations nr_node_seqops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) extern const struct seq_operations nr_neigh_seqops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) void nr_rt_free(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) /* nr_subr.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) void nr_clear_queues(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) void nr_frames_acked(struct sock *, unsigned short);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) void nr_requeue_frames(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) int nr_validate_nr(struct sock *, unsigned short);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) int nr_in_rx_window(struct sock *, unsigned short);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) void nr_write_internal(struct sock *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) * This routine is called when a Connect Acknowledge with the Choke Flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) * set is needed to refuse a connection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #define nr_transmit_refusal(skb, mine) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) do { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) __nr_transmit_reply((skb), (mine), NR_CONNACK | NR_CHOKE_FLAG); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) * This routine is called when we don't have a circuit matching an incoming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) * NET/ROM packet. This is an G8PZT Xrouter extension.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) #define nr_transmit_reset(skb, mine) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) do { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) __nr_transmit_reply((skb), (mine), NR_RESET); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) void nr_disconnect(struct sock *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /* nr_timer.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) void nr_init_timers(struct sock *sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) void nr_start_heartbeat(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) void nr_start_t1timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) void nr_start_t2timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) void nr_start_t4timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) void nr_start_idletimer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) void nr_stop_heartbeat(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) void nr_stop_t1timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) void nr_stop_t2timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) void nr_stop_t4timer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) void nr_stop_idletimer(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) int nr_t1timer_running(struct sock *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) /* sysctl_net_netrom.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) int nr_register_sysctl(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) void nr_unregister_sysctl(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) #endif