Mercurial > archived > louis > epitech > mq > rathaxes
annotate rathaxes_start_to_implement_sk_buff_in_the_lkm.patch @ 24:60dd543b67b0
WIP on the e1000 pci stuff
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Sat, 07 Jan 2012 20:02:23 +0100 |
parents | f0ab7ee21dd8 |
children | e330b0cea45e |
rev | line source |
---|---|
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
1 # HG changeset patch |
24
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
2 # Parent bffc8f046282cb07fab2c8ef86cf4fff344fdefc |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
3 rathaxes: add sk_buff abstraction and add the implementation of the xmit function for the ethernet system. We have a fully (empty) functionnal ethernet driver |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
4 |
23 | 5 diff --git a/rathaxes/samples/lkm/CMakeLists.txt b/rathaxes/samples/lkm/CMakeLists.txt |
6 --- a/rathaxes/samples/lkm/CMakeLists.txt | |
7 +++ b/rathaxes/samples/lkm/CMakeLists.txt | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
8 @@ -1,6 +1,6 @@ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
9 ADD_RATHAXES_SOURCES(lkm lkm.rtx |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
10 - RTI log.rti lkm.rti pci.rti ethernet.rti |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
11 - BLT log.blt lkm.blt pci.blt ethernet.blt) |
23 | 12 + RTI log.rti lkm.rti pci.rti socket.rti ethernet.rti e1000.rti |
13 + BLT log.blt lkm.blt pci.blt socket.blt ethernet.blt e1000.blt) | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
14 |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
15 # We can't name lkm since it's already used as the target name to generate the |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
16 # source (with ADD_RATHAXES_SOURCES). |
23 | 17 diff --git a/rathaxes/samples/lkm/e1000.blt b/rathaxes/samples/lkm/e1000.blt |
18 new file mode 100644 | |
19 --- /dev/null | |
20 +++ b/rathaxes/samples/lkm/e1000.blt | |
24
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
21 @@ -0,0 +1,49 @@ |
23 | 22 +with e1000, Ethernet, Socket, PCI, LKM, Log |
23 +{ | |
24 + template type e1000::Context() | |
25 + { | |
26 + chunk LKM::includes() | |
27 + { | |
28 + /* | |
29 + * Force the generation of the structure in the "headers part, we | |
30 + * have to do this since we do not use the structure in this blt | |
31 + * (we hacked a bit and used it in ethernet.blt directly). | |
32 + */ | |
33 + typedef int ${e1000::Context}; /* CNorm __std__ workaround */ | |
34 + ${e1000::Context} force_declaration_in_includes; | |
35 + } | |
36 + | |
37 + chunk ::decl() | |
38 + { | |
39 + struct rtx_e1000_ctx | |
40 + { | |
24
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
41 + unsigned char /* __iomem */ *ioaddr; |
23 | 42 + }; |
43 + } | |
44 + | |
45 + map | |
46 + { | |
47 + } | |
48 + } | |
49 + | |
50 + template sequence e1000::create() | |
51 + { | |
52 + chunk ::CALL | |
53 + { | |
54 + int bars = pci_select_bars(pdev, IORESOURCE_MEM); | |
55 + if (pci_enable_device_mem(pdev)) | |
56 + ${Log::info("e1000::create: pci_enable_device_mem failed")}; | |
24
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
57 + |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
58 + if (pci_request_selected_regions(pdev, bars, ${config.name})) |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
59 + ${Log::info("e1000::create: pci_request_selected_regions failed")}; |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
60 + |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
61 + if (${config.set_master}) |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
62 + pci_set_master(pdev); |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
63 + |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
64 + /* 0 here is for BAR_0: */ |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
65 + rtx_ether_ctx->hw_ctx.ioaddr = pci_ioremap_bar(pdev, 0); |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
66 + if (!rtx_ether_ctx->hw_ctx.ioaddr) |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
67 + ${Log::info("e1000::create: pci_ioremap_bar failed")}; |
23 | 68 + } |
69 + } | |
70 +} | |
71 diff --git a/rathaxes/samples/lkm/e1000.rti b/rathaxes/samples/lkm/e1000.rti | |
72 new file mode 100644 | |
73 --- /dev/null | |
74 +++ b/rathaxes/samples/lkm/e1000.rti | |
75 @@ -0,0 +1,10 @@ | |
76 +interface e1000 : Socket, Ethernet, PCI, LKM | |
77 +{ | |
78 + provided type e1000::Context; | |
79 + | |
80 + /* Not sure if we need the argument */ | |
81 + provided sequence e1000::create() | |
82 + { | |
83 + provided chunk ::CALL; | |
84 + } | |
85 +} | |
86 diff --git a/rathaxes/samples/lkm/ethernet.blt b/rathaxes/samples/lkm/ethernet.blt | |
87 --- a/rathaxes/samples/lkm/ethernet.blt | |
88 +++ b/rathaxes/samples/lkm/ethernet.blt | |
89 @@ -18,8 +18,11 @@ | |
90 * I think it's useless to use the ${PCI::Device} "abstraction" | |
91 * here, since we are already in a Linux specific context here. | |
92 */ | |
93 - struct pci_dev *pci_dev; | |
94 - struct net_device *net_dev; | |
95 + struct pci_dev *pci_dev; | |
96 + struct net_device *net_dev; | |
97 + | |
98 + /* while waiting on issue #8 */ | |
99 + struct rtx_e1000_ctx hw_ctx; | |
100 }; | |
101 } | |
102 | |
103 @@ -51,6 +54,24 @@ | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
104 } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
105 } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
106 |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
107 + template sequence Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
108 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
109 + chunk LKM::prototypes() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
110 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
111 + static int rtx_ethernet_xmit(struct sk_buff* skb, struct net_device *dev); |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
112 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
113 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
114 + chunk LKM::code() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
115 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
116 + static int rtx_ethernet_xmit(struct sk_buff* skb, struct net_device *dev) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
117 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
118 + ${pointcut ::IMPLEMENTATION}; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
119 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
120 + return 0; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
121 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
122 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
123 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
124 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
125 template sequence Ethernet::close(Ethernet::Device dev) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
126 { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
127 chunk LKM::prototypes() |
23 | 128 @@ -100,7 +121,7 @@ |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
129 { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
130 .ndo_open = rtx_ethernet_open, |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
131 .ndo_stop = rtx_ethernet_close, |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
132 - .ndo_start_xmit = NULL, |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
133 + .ndo_start_xmit = rtx_ethernet_xmit, |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
134 }; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
135 } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
136 |
23 | 137 diff --git a/rathaxes/samples/lkm/ethernet.rti b/rathaxes/samples/lkm/ethernet.rti |
138 --- a/rathaxes/samples/lkm/ethernet.rti | |
139 +++ b/rathaxes/samples/lkm/ethernet.rti | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
140 @@ -1,4 +1,4 @@ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
141 -interface Ethernet : PCI, LKM |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
142 +interface Ethernet : Socket, PCI, LKM |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
143 { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
144 provided type Ethernet::Device; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
145 |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
146 @@ -10,6 +10,12 @@ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
147 provided chunk LKM::code; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
148 } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
149 |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
150 + required sequence Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
151 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
152 + provided chunk LKM::prototypes; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
153 + provided chunk LKM::code; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
154 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
155 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
156 required sequence Ethernet::close(Ethernet::Device) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
157 { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
158 provided chunk LKM::prototypes; |
23 | 159 diff --git a/rathaxes/samples/lkm/lkm.rtx b/rathaxes/samples/lkm/lkm.rtx |
160 --- a/rathaxes/samples/lkm/lkm.rtx | |
161 +++ b/rathaxes/samples/lkm/lkm.rtx | |
162 @@ -15,10 +15,16 @@ | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
163 Log::info("Got an interruption"); |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
164 } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
165 |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
166 + Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
167 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
168 + Log::info("We have one packet to transmit!"); |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
169 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
170 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
171 PCI::probe(PCI::Device dev) |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
172 { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
173 Log::info("Probe the device"); |
23 | 174 Ethernet::init(dev); |
175 + e1000::create(); | |
176 } | |
177 | |
178 PCI::remove(PCI::Device dev) | |
24
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
179 @@ -49,6 +55,7 @@ |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
180 |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
181 PCI::vendor_id = 0x8086; |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
182 PCI::product_id = 0x100f; |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
183 + PCI::set_master = true; |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
184 |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
185 Ethernet::ifname = "rtx%d"; |
60dd543b67b0
WIP on the e1000 pci stuff
Louis Opter <louis@lse.epitech.net>
parents:
23
diff
changeset
|
186 } |
23 | 187 diff --git a/rathaxes/samples/lkm/socket.blt b/rathaxes/samples/lkm/socket.blt |
188 new file mode 100644 | |
189 --- /dev/null | |
190 +++ b/rathaxes/samples/lkm/socket.blt | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
191 @@ -0,0 +1,27 @@ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
192 +with Socket, LKM |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
193 +{ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
194 + template type Socket::SKBuff() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
195 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
196 + chunk LKM::includes() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
197 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
198 + #include <linux/sk_buff.h> |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
199 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
200 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
201 + chunk ::decl() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
202 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
203 + struct sk_buff; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
204 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
205 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
206 + chunk ::init() |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
207 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
208 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
209 + |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
210 + map |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
211 + { |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
212 + // some work may have to be done here in order |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
213 + // to access to some field of the sk_buff. |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
214 + // We should determine if all the sk_buff managment |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
215 + // can be abstracted from the user. |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
216 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
217 + } |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
218 +} |
23 | 219 diff --git a/rathaxes/samples/lkm/socket.rti b/rathaxes/samples/lkm/socket.rti |
220 new file mode 100644 | |
221 --- /dev/null | |
222 +++ b/rathaxes/samples/lkm/socket.rti | |
20
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
223 @@ -0,0 +1,4 @@ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
224 +interface Socket : LKM |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
225 +{ |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
226 + provided type Socket::SKBuff; |
ecf2a0e61fff
rathaxes: add sk_buff stuff
Thomas Sanchez <thomas.sanchz@gmail.com>
parents:
diff
changeset
|
227 +} |