]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ankh/include/lwip-ankh.h
update
[l4.git] / l4 / pkg / ankh / include / lwip-ankh.h
1 #pragma once
2
3 #include "lwip/tcpip.h"
4
5 enum
6 {
7         CFG_SHM_NAME_SIZE = 30,
8 };
9
10 typedef struct
11 {
12         unsigned bufsize;
13         l4_cap_idx_t send_thread;
14         l4_cap_idx_t recv_thread;
15         char shm_name[CFG_SHM_NAME_SIZE];
16 } ankh_config_info;
17
18
19 L4_INLINE void print_ip(ip_addr_t *ip)
20 {
21     printf("%d.%d.%d.%d",
22            ip4_addr1(ip),
23            ip4_addr2(ip),
24            ip4_addr3(ip),
25            ip4_addr4(ip));
26 }
27
28
29 L4_INLINE void __hexdump(unsigned char *buf, unsigned len)
30 {
31         unsigned i = 0;
32
33         for ( ; i < len; ++i)
34                 printf("%02x ", *(buf + i));
35         printf("\n");
36 }
37
38 /*
39  * Initialize an LWIP client up to the point where it becomes
40  * ready to send/receive. This includes
41  * 1) Ankh initialization
42  * 2) Setting up the LWIP network device
43  * 3) performing DHCP to obtain an IP
44  *
45  * Ankh arguments are extracted from argc and argv. Both are modified
46  * accordingly, so that it does not contain these args afterwards.
47  */
48 int l4_lwip_init(int *argc, char **argv);