aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/llc.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/net/llc.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/net/llc.h')
-rw-r--r--include/net/llc.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/include/net/llc.h b/include/net/llc.h
new file mode 100644
index 000000000000..c9aed2a8b4e2
--- /dev/null
+++ b/include/net/llc.h
@@ -0,0 +1,99 @@
1#ifndef LLC_H
2#define LLC_H
3/*
4 * Copyright (c) 1997 by Procom Technology, Inc.
5 * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
6 *
7 * This program can be redistributed or modified under the terms of the
8 * GNU General Public License as published by the Free Software Foundation.
9 * This program is distributed without any warranty or implied warranty
10 * of merchantability or fitness for a particular purpose.
11 *
12 * See the GNU General Public License for more details.
13 */
14
15#include <linux/if.h>
16#include <linux/if_ether.h>
17#include <linux/list.h>
18#include <linux/spinlock.h>
19
20struct net_device;
21struct packet_type;
22struct sk_buff;
23
24struct llc_addr {
25 unsigned char lsap;
26 unsigned char mac[IFHWADDRLEN];
27};
28
29#define LLC_SAP_STATE_INACTIVE 1
30#define LLC_SAP_STATE_ACTIVE 2
31
32/**
33 * struct llc_sap - Defines the SAP component
34 *
35 * @station - station this sap belongs to
36 * @state - sap state
37 * @p_bit - only lowest-order bit used
38 * @f_bit - only lowest-order bit used
39 * @laddr - SAP value in this 'lsap'
40 * @node - entry in station sap_list
41 * @sk_list - LLC sockets this one manages
42 */
43struct llc_sap {
44 unsigned char state;
45 unsigned char p_bit;
46 unsigned char f_bit;
47 int (*rcv_func)(struct sk_buff *skb,
48 struct net_device *dev,
49 struct packet_type *pt);
50 struct llc_addr laddr;
51 struct list_head node;
52 struct {
53 rwlock_t lock;
54 struct hlist_head list;
55 } sk_list;
56};
57
58#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
59#define LLC_DEST_SAP 1 /* Type 1 goes here */
60#define LLC_DEST_CONN 2 /* Type 2 goes here */
61
62extern struct list_head llc_sap_list;
63extern rwlock_t llc_sap_list_lock;
64extern unsigned char llc_station_mac_sa[ETH_ALEN];
65
66extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
67 struct packet_type *pt);
68
69extern int llc_mac_hdr_init(struct sk_buff *skb,
70 unsigned char *sa, unsigned char *da);
71
72extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap,
73 struct sk_buff *skb));
74extern void llc_remove_pack(int type);
75
76extern void llc_set_station_handler(void (*handler)(struct sk_buff *skb));
77
78extern struct llc_sap *llc_sap_open(unsigned char lsap,
79 int (*rcv)(struct sk_buff *skb,
80 struct net_device *dev,
81 struct packet_type *pt));
82extern void llc_sap_close(struct llc_sap *sap);
83
84extern struct llc_sap *llc_sap_find(unsigned char sap_value);
85
86extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
87 unsigned char *dmac, unsigned char dsap);
88
89extern int llc_station_init(void);
90extern void llc_station_exit(void);
91
92#ifdef CONFIG_PROC_FS
93extern int llc_proc_init(void);
94extern void llc_proc_exit(void);
95#else
96#define llc_proc_init() (0)
97#define llc_proc_exit() do { } while(0)
98#endif /* CONFIG_PROC_FS */
99#endif /* LLC_H */