Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / kernel / include / net / if.h
blobf4bcbe81b6b40cfe4a2515e1c4945cb67bd502f6
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _IF_H
21 #define _IF_H
23 #include <net/eth.h>
24 #include <net/net.h>
25 #include <net/ip.h>
27 /* type of the ip adddress configuration */
28 #define IF_CFG_TYPE_STATIC 0
29 #define IF_CFG_TYPE_DHCP 1
30 #define IF_CFG_TYPE_RADVERT 2 /* ipv6 only */
32 /* Network interface structure */
33 typedef struct netif_context {
34 struct netif_context *next, *prev;
36 //struct netaddr_t *addr;
37 struct netdev_t *dev;
38 net_ipv4 ip;
39 net_ipv4 gw;
40 net_ipv6 ipv6;
41 net_ipv6 gwv6;
42 char *buf_rx;
43 char *buf_tx;
44 unsigned char cfg;
45 unsigned char cfgv6;
46 } netif_t;
48 extern unsigned netif_ip_addr (netif_t *netif, net_ipv4 ip, unsigned char cfg);
49 extern unsigned netif_ipv6_addr (netif_t *netif, net_ipv6 ip, unsigned char cfg);
50 extern unsigned netif_gw_addr (netif_t *netif, net_ipv4 gw);
51 extern unsigned netif_gwv6_addr (netif_t *netif, net_ipv6 gw);
52 extern netif_t *netif_findbyname (char *name);
53 extern netif_t *netif_create (struct netdev_t *dev);
54 extern void iflist_display ();
55 extern net_port netif_port_get ();
56 extern unsigned init_netif ();
58 #endif