
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
34 lines
1.3 KiB
C
34 lines
1.3 KiB
C
#ifndef MINIX_NET_LWIP_ADDR_H
|
|
#define MINIX_NET_LWIP_ADDR_H
|
|
|
|
int addr_is_unspec(const struct sockaddr * addr, socklen_t addr_len);
|
|
|
|
int addr_is_valid_multicast(const ip_addr_t * ipaddr);
|
|
|
|
int addr_get_inet(const struct sockaddr * addr, socklen_t addr_len,
|
|
uint8_t type, ip_addr_t * ipaddr, int kame, uint16_t * port);
|
|
void addr_put_inet(struct sockaddr * addr, socklen_t * addr_len,
|
|
const ip_addr_t * ipaddr, int kame, uint16_t port);
|
|
|
|
int addr_get_link(const struct sockaddr * addr, socklen_t addr_len,
|
|
char * name, size_t name_max, uint8_t * hwaddr, size_t hwaddr_len);
|
|
void addr_put_link(struct sockaddr * addr, socklen_t * addr_len,
|
|
uint32_t ifindex, uint32_t type, const char * name,
|
|
const uint8_t * hwaddr, size_t hwaddr_len);
|
|
|
|
int addr_get_netmask(const struct sockaddr * addr, socklen_t addr_len,
|
|
uint8_t type, unsigned int * prefix, ip_addr_t * ipaddr);
|
|
void addr_make_netmask(uint8_t * addr, socklen_t addr_len,
|
|
unsigned int prefix);
|
|
void addr_put_netmask(struct sockaddr * addr, socklen_t * addr_len,
|
|
uint8_t type, unsigned int prefix);
|
|
|
|
void addr_normalize(ip_addr_t * dst, const ip_addr_t * src,
|
|
unsigned int prefix);
|
|
unsigned int addr_get_common_bits(const ip_addr_t * addr1,
|
|
const ip_addr_t * addr2, unsigned int max);
|
|
|
|
void addr_make_v4mapped_v6(ip_addr_t * dst, const ip4_addr_t * src);
|
|
|
|
#endif /* !MINIX_NET_LWIP_ADDR_H */
|