diff --git a/include/net/if_arp.h b/include/net/if_arp.h index 2ffc3055..14b54f19 100644 --- a/include/net/if_arp.h +++ b/include/net/if_arp.h @@ -40,6 +40,7 @@ #define ARPHRD_CSLIP6 129 #define ARPHRD_PPP 130 #define ARPHRD_LOOPBACK 131 +#define ARPHRD_SIT 132 /* sit0 device - IPv6-in-IPv4. */ struct arphdr { unsigned short int ar_hrd; /* Format of hardware address. */ diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h new file mode 100644 index 00000000..b5806d3a --- /dev/null +++ b/include/net/ip6_route.h @@ -0,0 +1,38 @@ +/* + * Phoenix-RTOS + * + * libphoenix + * + * net/ip6_route.h + * + * Copyright 2024 Phoenix Systems + * Author: Mateusz Kobak + * + * This file is part of Phoenix-RTOS. + * + * %LICENSE% + */ + + +#ifndef _NET_IP6_ROUTE_H_ +#define _NET_IP6_ROUTE_H_ + +#include + +/* Needed by route.c in busybox */ +struct in6_rtmsg +{ + struct in6_addr rtmsg_dst; + struct in6_addr rtmsg_src; + struct in6_addr rtmsg_gateway; + uint32_t rtmsg_type; + uint16_t rtmsg_dst_len; + uint16_t rtmsg_src_len; + uint32_t rtmsg_metric; + unsigned long int rtmsg_info; + uint32_t rtmsg_flags; + int rtmsg_ifindex; +}; + + +#endif /* _NET_IP6_ROUTE_H_ */ diff --git a/include/net/route.h b/include/net/route.h index 465a01f4..0473ecb2 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -13,6 +13,9 @@ #define RTF_WINDOW 0x0080 #define RTF_IRTT 0x0100 #define RTF_REJECT 0x0200 +#define RTF_DEFAULT 0x0400 +#define RTF_ADDRCONF 0x0800 +#define RTF_CACHE 0x1000 #define RTF_NONEXTHOP 0x00200000 diff --git a/include/netinet/icmp6.h b/include/netinet/icmp6.h new file mode 100644 index 00000000..70ab305e --- /dev/null +++ b/include/netinet/icmp6.h @@ -0,0 +1,64 @@ +/* + * Phoenix-RTOS + * + * libphoenix + * + * netinet/icmp6.h + * + * Copyright 2024 Phoenix Systems + * Author: Mateusz Kobak + * + * This file is part of Phoenix-RTOS. + * + * %LICENSE% + */ + +#ifndef _NETINET_ICMP6_H +#define _NETINET_ICMP6_H + +#include + + +struct icmp6_hdr { + uint8_t icmp6_type; /* type field */ + uint8_t icmp6_code; /* code field */ + uint16_t icmp6_cksum; /* checksum field */ + union { + uint32_t icmp6_un_data32[1]; /* type-specific field */ + uint16_t icmp6_un_data16[2]; /* type-specific field */ + uint8_t icmp6_un_data8[4]; /* type-specific field */ + } icmp6_dataun; +}; + +#define icmp6_data32 icmp6_dataun.icmp6_un_data32 +#define icmp6_data16 icmp6_dataun.icmp6_un_data16 +#define icmp6_data8 icmp6_dataun.icmp6_un_data8 +#define icmp6_pptr icmp6_data32[0] /* parameter prob */ +#define icmp6_mtu icmp6_data32[0] /* packet too big */ +#define icmp6_id icmp6_data16[0] /* echo request/reply */ +#define icmp6_seq icmp6_data16[1] /* echo request/reply */ +#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */ + +#define ICMP6_DST_UNREACH 1 +#define ICMP6_PACKET_TOO_BIG 2 +#define ICMP6_TIME_EXCEEDED 3 +#define ICMP6_PARAM_PROB 4 + +#define ICMP6_ECHO_REQUEST 128 +#define ICMP6_ECHO_REPLY 129 +#define MLD_LISTENER_QUERY 130 +#define MLD_LISTENER_REPORT 131 +#define MLD_LISTENER_REDUCTION 132 + +#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ +#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ + +#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ +#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ +#define ICMP6_DST_UNREACH_NOPORT 4 /* bad port */ + +#define ICMP6_TIME_EXCEED_TRANSIT 0 /* Hop Limit == 0 in transit */ +#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* Reassembly time out */ + + +#endif /* _NETINET_ICMP6_H */ diff --git a/include/netinet/in.h b/include/netinet/in.h index d86079d9..8c45baff 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -63,6 +63,7 @@ enum { IPPROTO_GRE = 47, IPPROTO_ESP = 50, IPPROTO_AH = 51, + IPPROTO_ICMPV6 = 58, IPPROTO_SCTP = 132, IPPROTO_UDPLITE = 136, IPPROTO_RAW = 255, diff --git a/include/sys/sockdefs.h b/include/sys/sockdefs.h index 4dca1d4e..b0e047c2 100644 --- a/include/sys/sockdefs.h +++ b/include/sys/sockdefs.h @@ -19,4 +19,13 @@ #define SOCK_NONBLOCK 0x8000 #define SOCK_CLOEXEC 0x4000 +#define SOL_IPV6 41 /* IPPROTO_IPV6 */ +#define SOL_RAW 255 /* IPPROTO_RAW */ + +/* + * Options for level IPPROTO_IPV6 + */ +#define IPV6_CHECKSUM 7 +#define IPV6_V6ONLY 27 + #endif