
This commit adds a new TCP/IP service to MINIX 3. As its core, the service uses the lwIP TCP/IP stack for maintenance reasons. The service aims to be compatible with NetBSD userland, including its low-level network management utilities. It also aims to support modern features such as IPv6. In summary, the new LWIP service has support for the following main features: - TCP, UDP, RAW sockets with mostly standard BSD API semantics; - IPv6 support: host mode (complete) and router mode (partial); - most of the standard BSD API socket options (SO_); - all of the standard BSD API message flags (MSG_); - the most used protocol-specific socket and control options; - a default loopback interface and the ability to create one more; - configuration-free ethernet interfaces and driver tracking; - queuing and multiple concurrent requests to each ethernet driver; - standard ioctl(2)-based BSD interface management; - radix tree backed, destination-based routing; - routing sockets for standard BSD route reporting and management; - multicast traffic and multicast group membership tracking; - Berkeley Packet Filter (BPF) devices; - standard and custom sysctl(7) nodes for many internals; - a slab allocation based, hybrid static/dynamic memory pool model. Many of its modules come with fairly elaborate comments that cover many aspects of what is going on. The service is primarily a socket driver built on top of the libsockdriver library, but for BPF devices it is at the same time also a character driver. Change-Id: Ib0c02736234b21143915e5fcc0fda8fe408f046f
40 lines
1.7 KiB
C
40 lines
1.7 KiB
C
#ifndef MINIX_NET_LWIP_ROUTE_H
|
|
#define MINIX_NET_LWIP_ROUTE_H
|
|
|
|
#include <net/route.h>
|
|
|
|
struct route_entry;
|
|
struct rtsock_request;
|
|
|
|
void route_init(void);
|
|
int route_add(const ip_addr_t * addr, unsigned int prefix,
|
|
const ip_addr_t * gateway, struct ifdev * ifdev, unsigned int flags,
|
|
const struct rtsock_request * rtr);
|
|
int route_can_add(const ip_addr_t * addr, unsigned int prefix, int is_host);
|
|
struct route_entry *route_find(const ip_addr_t * addr, unsigned int prefix,
|
|
int is_host);
|
|
struct route_entry *route_lookup(const ip_addr_t * addr);
|
|
void route_delete(struct route_entry * route,
|
|
const struct rtsock_request * rtr);
|
|
void route_clear(struct ifdev * ifdev);
|
|
int route_process(unsigned int type, const struct sockaddr * dst,
|
|
const struct sockaddr * mask, const struct sockaddr * gateway,
|
|
const struct sockaddr * ifp, const struct sockaddr * ifa,
|
|
unsigned int flags, unsigned long inits,
|
|
const struct rt_metrics * rmx, const struct rtsock_request * rtr);
|
|
void route_get(const struct route_entry * route, union sockaddr_any * addr,
|
|
union sockaddr_any * mask, union sockaddr_any * gateway,
|
|
union sockaddr_any * ifp, union sockaddr_any * ifa,
|
|
struct ifdev ** ifdev, unsigned int * flags, unsigned int * use);
|
|
unsigned int route_get_flags(const struct route_entry * route);
|
|
struct ifdev *route_get_ifdev(const struct route_entry * route);
|
|
int route_is_ipv6(const struct route_entry * route);
|
|
struct route_entry *route_enum_v4(struct route_entry * last);
|
|
struct route_entry *route_enum_v6(struct route_entry * last);
|
|
int route_output_v4(struct ifdev * ifdev, const ip4_addr_t * ipaddr,
|
|
err_t * err);
|
|
int route_output_v6(struct ifdev * ifdev, const ip6_addr_t * ipaddr,
|
|
err_t * err);
|
|
|
|
#endif /* !MINIX_NET_LWIP_ROUTE_H */
|