This source file includes following definitions.
- p8022_request
- register_8022_client
- unregister_8022_client
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include <linux/module.h>
15 #include <linux/netdevice.h>
16 #include <linux/skbuff.h>
17 #include <linux/slab.h>
18 #include <net/datalink.h>
19 #include <linux/mm.h>
20 #include <linux/in.h>
21 #include <linux/init.h>
22 #include <net/llc.h>
23 #include <net/p8022.h>
24
25 static int p8022_request(struct datalink_proto *dl, struct sk_buff *skb,
26 unsigned char *dest)
27 {
28 llc_build_and_send_ui_pkt(dl->sap, skb, dest, dl->sap->laddr.lsap);
29 return 0;
30 }
31
32 struct datalink_proto *register_8022_client(unsigned char type,
33 int (*func)(struct sk_buff *skb,
34 struct net_device *dev,
35 struct packet_type *pt,
36 struct net_device *orig_dev))
37 {
38 struct datalink_proto *proto;
39
40 proto = kmalloc(sizeof(*proto), GFP_ATOMIC);
41 if (proto) {
42 proto->type[0] = type;
43 proto->header_length = 3;
44 proto->request = p8022_request;
45 proto->sap = llc_sap_open(type, func);
46 if (!proto->sap) {
47 kfree(proto);
48 proto = NULL;
49 }
50 }
51 return proto;
52 }
53
54 void unregister_8022_client(struct datalink_proto *proto)
55 {
56 llc_sap_put(proto->sap);
57 kfree(proto);
58 }
59
60 EXPORT_SYMBOL(register_8022_client);
61 EXPORT_SYMBOL(unregister_8022_client);
62
63 MODULE_LICENSE("GPL");