[LWIP]
[reactos.git] / reactos / lib / drivers / lwip / src / rosip.c
1 #include "lwip/sys.h"
2 #include "lwip/tcpip.h"
3
4 #include "rosip.h"
5
6 #include <debug.h>
7
8 typedef struct netif* PNETIF;
9
10 void
11 LibIPInsertPacket(void *ifarg,
12 const void *const data,
13 const u32_t size)
14 {
15 struct pbuf *p;
16
17 ASSERT(ifarg);
18 ASSERT(data);
19 ASSERT(size > 0);
20
21 p = pbuf_alloc(PBUF_RAW, size, PBUF_RAM);
22 if (p)
23 {
24 ASSERT(p->tot_len == p->len);
25 ASSERT(p->len == size);
26
27 RtlCopyMemory(p->payload, data, p->len);
28
29 ((PNETIF)ifarg)->input(p, (PNETIF)ifarg);
30 }
31 }
32
33 void
34 LibIPInitialize(void)
35 {
36 /* This completes asynchronously */
37 tcpip_init(NULL, NULL);
38 }
39
40 void
41 LibIPShutdown(void)
42 {
43 /* This is synchronous */
44 sys_shutdown();
45 }