]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ankh/include/lwip-ankh.h
6f7405e37bd00c222dd462aca633e25fa588088a
[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 static 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 static void __attribute__((unused))
30 __hexdump(unsigned char *buf, unsigned len)
31 {
32         unsigned i = 0;
33
34         for ( ; i < len; ++i)
35                 printf("%02x ", *(buf + i));
36         printf("\n");
37 }
38
39 /*
40  * Initialize an LWIP client up to the point where it becomes
41  * ready to send/receive. This includes
42  * 1) Ankh initialization
43  * 2) Setting up the LWIP network device
44  * 3) performing DHCP to obtain an IP
45  *
46  * Ankh arguments are extracted from argc and argv. Both are modified
47  * accordingly, so that it does not contain these args afterwards.
48  */
49 int l4_lwip_init(int *argc, char **argv);