diff --git a/include/net/if_arp.h b/include/net/if_arp.h index 2ffc3055..16b07403 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..4b5a6749 --- /dev/null +++ b/include/net/ip6_route.h @@ -0,0 +1,40 @@ +/* + * Phoenix-RTOS + * + * libphoenix + * + * net/ip6_route.h + * + * Copyright 2024 Phoenix Systems + * Author: Mateusz Kobak + * + * This file is part of Phoenix-RTOS. + * + * %LICENSE% + */ + + +#ifndef _LIBPHOENIX_NET_IP6_ROUTE_H +#define _LIBPHOENIX_NET_IP6_ROUTE_H + +#include + +/* + * This is needed to compile route.c in busybox. + * Routes for IPv6 are not implemented yet + */ +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 /* _LIBPHOENIX_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..2964c09e --- /dev/null +++ b/include/netinet/icmp6.h @@ -0,0 +1,53 @@ +/* + * 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 + +#endif /* _NETINET_ICMP6_H */ diff --git a/include/netinet/in.h b/include/netinet/in.h index d86079d9..468d23b8 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, @@ -94,6 +95,9 @@ extern const struct in6_addr in6addr_loopback; #define IPV6_UNICAST_HOPS 0x00000020 /* Unicast hop limit */ #define IPV6_V6ONLY 0x00000040 /* Restrict AF_INET6 socket to IPv6 communications only */ +#define IPV6_CHECKSUM 7 +#define IPV6_HOPLIMIT 52 /* not implemented */ + /* IPv6 multicast address scopes */ #define IPv6_ADDR_MC_SCOPE_NODELOCAL 0x1 /* Interface-Local scope */ #define IPv6_ADDR_MC_SCOPE_LINKLOCAL 0x2 /* Link-Local scope */ diff --git a/include/sys/sockdefs.h b/include/sys/sockdefs.h index 4dca1d4e..291ab0ee 100644 --- a/include/sys/sockdefs.h +++ b/include/sys/sockdefs.h @@ -19,4 +19,7 @@ #define SOCK_NONBLOCK 0x8000 #define SOCK_CLOEXEC 0x4000 +#define SOL_IPV6 41 /* IPPROTO_IPV6 */ +#define SOL_RAW 255 /* IPPROTO_RAW */ + #endif