summaryrefslogtreecommitdiff
path: root/include/linux/llc.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>2002-05-30 18:36:32 -0300
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>2002-05-30 18:36:32 -0300
commit34beb106cde7da233d4df35dd3d6cf4fee937caa (patch)
tree2f6047513722259104cccc8fcb3aded043af4ce3 /include/linux/llc.h
parentd0f0cde199764cb083b3617c3739f45b1a73052d (diff)
net/llc/*.c
Forward port of LLC from 2.4 to 2.5. This is the forward port of the LLC stack released by Procom Inc. for Linux 2.0.30, I have heavily modified it to make it similar to other Linux network stacks, using of struct sk_buff to represent in-transit packets and doing massive code cleanups. Jay Schullist contributed support for BSD Sockets, as the original code had only a simple in kernel API for use by upper layer protocols, such as the NetBEUI stack also provided by Procom for 2.0.30. This code is basically what I had previously submitted to Alan Cox for his 2.4-ac series and that is even shipped in source form, in the Red Hat 7.3 kernel package, plus cleanups wrt standard syntax for labeled elements and further use of this C construct to make the code more resilient to editing mistakes, using the compiler to further check the source code. TODO: Make it completely SMP safe, as the reports of successful usage up to now and the testing is done on UP. Completely remove the old LLC code in the kernel, that is still there for things like Appletalk, IPX, etc to use, also check that all these protocols work correctly with this new LLC stack. This code is already being used in the linux-sna project and Jay Schullist has been developing support for things like DLSw and other protocols that works on top of 802.2. I'll be releasing patches with the NetBEUI stack and updated samba-2.0.6 patches for use with NetBEUI and this LLC stack in the future. But the NetBEUI code is available already in my kernel.org ftp area at: ftp://ftp.kernel.org/pub/linux/kernel/people/acme. Please report problems to me or the linux-sna mailing list, instructions on how to subscribe are available at http://www.linux-sna.org website.
Diffstat (limited to 'include/linux/llc.h')
-rw-r--r--include/linux/llc.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/include/linux/llc.h b/include/linux/llc.h
new file mode 100644
index 000000000000..824a149e9e6b
--- /dev/null
+++ b/include/linux/llc.h
@@ -0,0 +1,102 @@
+#ifndef __LINUX_LLC_H
+#define __LINUX_LLC_H
+/*
+ * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
+ *
+ * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#define __LLC_SOCK_SIZE__ 28 /* sizeof(sockaddr_llc), word align. */
+struct sockaddr_llc {
+ sa_family_t sllc_family; /* AF_LLC */
+ sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
+ unsigned char sllc_test;
+ unsigned char sllc_xid;
+ unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
+ unsigned char sllc_dsap;
+ unsigned char sllc_ssap;
+ unsigned char sllc_dmac[IFHWADDRLEN];
+ unsigned char sllc_smac[IFHWADDRLEN];
+ unsigned char sllc_mmac[IFHWADDRLEN];
+ unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
+ sizeof(unsigned char) * 5 - IFHWADDRLEN * 3];
+};
+
+/* sockopt definitions. */
+enum llc_sockopts {
+ LLC_OPT_UNKNOWN = 0,
+ LLC_OPT_RETRY, /* max retrans attempts. */
+ LLC_OPT_SIZE, /* max PDU size (octets). */
+ LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
+ LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
+ LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
+ LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
+ LLC_OPT_TX_WIN, /* tx window size. */
+ LLC_OPT_RX_WIN, /* rx window size. */
+ LLC_OPT_MAX
+};
+
+#define LLC_OPT_MAX_RETRY 100
+#define LLC_OPT_MAX_SIZE 4196
+#define LLC_OPT_MAX_WIN 127
+#define LLC_OPT_MAX_ACK_TMR_EXP 60
+#define LLC_OPT_MAX_P_TMR_EXP 60
+#define LLC_OPT_MAX_REJ_TMR_EXP 60
+#define LLC_OPT_MAX_BUSY_TMR_EXP 60
+
+/* LLC SAP types. */
+#define LLC_SAP_NULL 0x00 /* NULL SAP. */
+#define LLC_SAP_LLC 0x02 /* LLC Sublayer Managment. */
+#define LLC_SAP_SNA 0x04 /* SNA Path Control. */
+#define LLC_SAP_PNM 0x0E /* Proway Network Managment. */
+#define LLC_SAP_IP 0x06 /* TCP/IP. */
+#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
+#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
+#define LLC_SAP_8208 0x7E /* ISO 8208 */
+#define LLC_SAP_3COM 0x80 /* 3COM. */
+#define LLC_SAP_PRO 0x8E /* Proway Active Station List */
+#define LLC_SAP_SNAP 0xAA /* SNAP. */
+#define LLC_SAP_BANYAN 0xBC /* Banyan. */
+#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
+#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
+#define LLC_SAP_LANMGR 0xF4 /* LanManager. */
+#define LLC_SAP_IMPL 0xF8 /* IMPL */
+#define LLC_SAP_DISC 0xFC /* Discovery */
+#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
+#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
+#define LLC_SAP_RM 0xD4 /* Resource Management */
+#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
+
+#ifdef __KERNEL__
+#define LLC_SAP_DYN_START 0xC0
+#define LLC_SAP_DYN_STOP 0xDE
+#define LLC_SAP_DYN_TRIES 4
+
+struct sock;
+
+struct llc_ui_opt {
+ u16 link; /* network layer link number */
+ struct llc_sap *sap; /* pointer to parent SAP */
+ struct sock *core_sk;
+ struct net_device *dev; /* device to send to remote */
+ struct sockaddr_llc addr; /* address sock is bound to */
+};
+
+#define llc_ui_sk(__sk) ((struct llc_ui_opt *)(__sk)->protinfo)
+#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
+
+#ifdef CONFIG_LLC_UI
+extern int llc_ui_init(void);
+extern void llc_ui_exit(void);
+#else
+#define llc_ui_init()
+#define llc_ui_exit()
+#endif
+#endif /* __KERNEL__ */
+#endif /* __LINUX_LLC_H */