ReactOS  0.4.15-dev-3308-g9455def
rosip.c
Go to the documentation of this file.
1 #include "lwip/sys.h"
2 #include "lwip/netif.h"
3 #include "lwip/tcpip.h"
4 
5 #include "rosip.h"
6 
7 #include <debug.h>
8 
9 typedef struct netif* PNETIF;
10 
11 void
12 LibIPInsertPacket(void *ifarg,
13  const void *const data,
14  const u32_t size)
15 {
16  struct pbuf *p;
17 
18  ASSERT(ifarg);
19  ASSERT(data);
20  ASSERT(size > 0);
21 
23  if (p)
24  {
25  ASSERT(p->tot_len == p->len);
26  ASSERT(p->len == size);
27 
28  RtlCopyMemory(p->payload, data, p->len);
29 
30  ((PNETIF)ifarg)->input(p, (PNETIF)ifarg);
31  }
32 }
33 
34 void
36 {
37  /* This completes asynchronously */
39 }
40 
41 void
43 {
44  /* This is synchronous */
45  sys_shutdown();
46 }
void LibIPShutdown(void)
Definition: rosip.c:42
struct netif * PNETIF
Definition: rosip.c:9
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
Definition: pbuf.c:207
Definition: pbuf.h:58
void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size)
Definition: rosip.c:12
Definition: pbuf.h:54
void LibIPInitialize(void)
Definition: rosip.c:35
GLsizeiptr size
Definition: glext.h:5919
#define ASSERT(a)
Definition: mode.c:44
Definition: pbuf.h:79
unsigned long u32_t
Definition: cc.h:25
Definition: netif.h:136
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void tcpip_init(tcpip_init_done_fn initfunc, void *arg)
Definition: tcpip.c:456
#define NULL
Definition: types.h:112
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
void sys_shutdown(void)
Definition: sys_arch.c:337
GLfloat GLfloat p
Definition: glext.h:8902