From: falcovorbis <fal...@us...> - 2023-11-18 19:41:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via f8644374d6beaf41365e30d185cb455f340c7014 (commit) via 7837ad40d53f11e078cbfa668594c98be2fd75b5 (commit) from ed6c8f946d1ff8f59de05f02e8772b81298cae59 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f8644374d6beaf41365e30d185cb455f340c7014 Merge: ed6c8f9 7837ad4 Author: Falco Girgis <gyr...@gm...> Date: Sat Nov 18 13:41:16 2023 -0600 Merge pull request #373 from KallistiOS/netinet-udp-h Add <netinet/udp.h> and <netinet/udplite.h> headers commit 7837ad40d53f11e078cbfa668594c98be2fd75b5 Author: Lawrence Sebald <ljs...@us...> Date: Sat Nov 18 14:28:25 2023 -0500 Add <netinet/udp.h> and <netinet/udplite.h> headers. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 2 ++ include/netinet/in.h | 35 +++------------------------------- include/netinet/udp.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++ include/netinet/udplite.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++ kernel/net/net_udp.c | 2 ++ 5 files changed, 102 insertions(+), 32 deletions(-) create mode 100644 include/netinet/udp.h create mode 100644 include/netinet/udplite.h diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 6cfd0bb..26be8ae 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -205,6 +205,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Refactored sfx and streaming to add SQ fast path [RR] - DC Added 4/8-bit wav support to sfx and streaming [RR] - *** Added <netinet/tcp.h> header file and required option [LS] +- *** Added <netinet/udp.h> and <netinet/udplite.h> headers and move the related + content from <netinet/in.h> [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/include/netinet/in.h b/include/netinet/in.h index 1ddd45b..765967b 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -201,7 +201,9 @@ extern const struct in6_addr in6addr_loopback; @{ */ + #define IP_TTL 24 /**< \brief TTL for unicast (get/set) */ + /** @} */ /** \defgroup ipv6_opts IPv6 protocol level options @@ -220,6 +222,7 @@ extern const struct in6_addr in6addr_loopback; @{ */ + #define IPV6_JOIN_GROUP 17 /**< \brief Join a multicast group (set) */ #define IPV6_LEAVE_GROUP 18 /**< \brief Leave a multicast group (set) */ #define IPV6_MULTICAST_HOPS 19 /**< \brief Hop limit for multicast (get/set) */ @@ -227,39 +230,7 @@ extern const struct in6_addr in6addr_loopback; #define IPV6_MULTICAST_LOOP 21 /**< \brief Multicasts loopback (get/set) */ #define IPV6_UNICAST_HOPS 22 /**< \brief Hop limit for unicast (get/set) */ #define IPV6_V6ONLY 23 /**< \brief IPv6 only -- no IPv4 (get/set) */ -/** @} */ - -/** \defgroup udp_opts UDP protocol level options - - These are the various socket-level options that can be accessed with the - setsockopt() and getsockopt() functions for the IPPROTO_UDP level value. - - \see so_opts - \see ipv4_opts - \see ipv6_opts - \see udplite_opts - \see tcp_opts - - @{ -*/ -#define UDP_NOCHECKSUM 25 /**< \brief Don't calculate UDP checksums */ -/** @} */ - -/** \defgroup udplite_opts UDP-Lite protocol level options - - These are the various socket-level options that can be accessed with the - setsockopt() and getsockopt() functions for the IPPROTO_UDPLITE level value. - - \see so_opts - \see ipv4_opts - \see ipv6_opts - \see udp_opts - \see tcp_opts - @{ -*/ -#define UDPLITE_SEND_CSCOV 26 /**< \brief Sending checksum coverage. */ -#define UDPLITE_RECV_CSCOV 27 /**< \brief Receiving checksum coverage. */ /** @} */ /** \brief Test if an IPv6 Address is unspecified. diff --git a/include/netinet/udp.h b/include/netinet/udp.h new file mode 100644 index 0000000..93e2099 --- /dev/null +++ b/include/netinet/udp.h @@ -0,0 +1,47 @@ +/* KallistiOS ##version## + + netinet/udp.h + Copyright (C) 2014, 2023 Lawrence Sebald + +*/ + +/** \file netinet/udp.h + \brief Definitions for the User Datagram Protocol. + + This file contains definitions related to the User Datagram Protocol (UDP). + UDP is a connectionless datagram delivery protocol, which provides optional + datagram integrity validation. + + UDP is described in RFC 768. + + \author Lawrence Sebald +*/ + +#ifndef __NETINET_UDP_H +#define __NETINET_UDP_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/** \defgroup udp_opts UDP protocol level options + + These are the various socket-level options that can be accessed with the + setsockopt() and getsockopt() functions for the IPPROTO_UDP level value. + + \see so_opts + \see ipv4_opts + \see ipv6_opts + \see udplite_opts + \see tcp_opts + + @{ +*/ + +#define UDP_NOCHECKSUM 25 /**< \brief Don't calculate UDP checksums */ + +/** @} */ + +__END_DECLS + +#endif /* !__NETINET_UDP_H */ diff --git a/include/netinet/udplite.h b/include/netinet/udplite.h new file mode 100644 index 0000000..b1f4daa --- /dev/null +++ b/include/netinet/udplite.h @@ -0,0 +1,48 @@ +/* KallistiOS ##version## + + netinet/udplite.h + Copyright (C) 2014, 2023 Lawrence Sebald + +*/ + +/** \file netinet/udplite.h + \brief Definitions for UDP-Lite. + + This file contains definitions related to UDP-Lite, a version of UDP that + allows for partial checksum coverage (rather than requiring that either all + or none of the packet is covered as does UDP). + + UDP-Lite is described in RFC 3828. + + \author Lawrence Sebald +*/ + +#ifndef __NETINET_UDPLITE_H +#define __NETINET_UDPLITE_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/** \defgroup udplite_opts UDP-Lite protocol level options + + These are the various socket-level options that can be accessed with the + setsockopt() and getsockopt() functions for the IPPROTO_UDPLITE level value. + + \see so_opts + \see ipv4_opts + \see ipv6_opts + \see udp_opts + \see tcp_opts + + @{ +*/ + +#define UDPLITE_SEND_CSCOV 26 /**< \brief Sending checksum coverage. */ +#define UDPLITE_RECV_CSCOV 27 /**< \brief Receiving checksum coverage. */ + +/** @} */ + +__END_DECLS + +#endif /* !__NETINET_UDPLITE_H */ diff --git a/kernel/net/net_udp.c b/kernel/net/net_udp.c index af5403f..dcfe97e 100644 --- a/kernel/net/net_udp.c +++ b/kernel/net/net_udp.c @@ -19,6 +19,8 @@ #include <kos/fs_socket.h> #include <arch/irq.h> #include <sys/socket.h> +#include <netinet/udp.h> +#include <netinet/udplite.h> #include "net_ipv4.h" #include "net_ipv6.h" hooks/post-receive -- A pseudo Operating System for the Dreamcast. |