Differences From Artifact [77a6b954f7]:
- File src/OFSocket.h — part of check-in [9934ed3ac2] at 2022-10-22 22:37:03 on branch trunk — Fix compilation for systems without sockaddr_at (user: js, size: 11862) [annotate] [blame] [check-ins using] [more...]
To Artifact [fc6ec6273c]:
- File
src/OFSocket.h
— part of check-in
[0b4f713964]
at
2022-10-30 18:58:13
on branch trunk
— Remove AppleTalk support again
It seems that neither Windows nor macOS support DDP sockets, but only
the layers on top, while neither Linux nor NetBSD support the layers on
top, but only provide DDP.It seems that DDP is not meant to be used directly, while Linux and
NetBSD only provide the minimum to use netatalk, which is DDP. ObjFW
would need to use the layers on top on Windows and macOS and implement
those layers itself on Linux and NetBSD. This also means that no code
would be shared between Linux / NetBSD and Windows / macOS, as it's
impossible to have one implementation that works for everything. At this
point, the effort required doesn't make sense. (user: js, size: 9155) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
40 41 42 43 44 45 46 | #endif #ifdef OF_HAVE_AFUNIX_H # include <afunix.h> #endif #ifdef OF_HAVE_NETIPX_IPX_H # include <netipx/ipx.h> #endif | < < < < < < | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #endif #ifdef OF_HAVE_AFUNIX_H # include <afunix.h> #endif #ifdef OF_HAVE_NETIPX_IPX_H # include <netipx/ipx.h> #endif #ifdef OF_WINDOWS # include <windows.h> # include <ws2tcpip.h> # ifdef OF_HAVE_IPX # include <wsipx.h> # endif #endif /** @file */ #ifdef OF_WII # include <network.h> #endif |
︙ | ︙ | |||
105 106 107 108 109 110 111 | OFSocketAddressFamilyIPv4, /** IPv6 */ OFSocketAddressFamilyIPv6, /** UNIX */ OFSocketAddressFamilyUNIX, /** IPX */ OFSocketAddressFamilyIPX, | < < | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | OFSocketAddressFamilyIPv4, /** IPv6 */ OFSocketAddressFamilyIPv6, /** UNIX */ OFSocketAddressFamilyUNIX, /** IPX */ OFSocketAddressFamilyIPX, /** Any address family */ OFSocketAddressFamilyAny = 255 } OFSocketAddressFamily; #ifndef OF_HAVE_IPV6 struct sockaddr_in6 { sa_family_t sin6_family; |
︙ | ︙ | |||
148 149 150 151 152 153 154 | # define IPX_NODE_LEN 6 # define sipx_family sa_family # define sipx_network sa_netnum # define sipx_node sa_nodenum # define sipx_port sa_socket #endif | < < < < < < < < < < < < < < < < < < | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | # define IPX_NODE_LEN 6 # define sipx_family sa_family # define sipx_network sa_netnum # define sipx_node sa_nodenum # define sipx_port sa_socket #endif /** * @struct OFSocketAddress OFSocket.h ObjFW/OFSocket.h * * @brief A struct which represents a host / port pair for a socket. */ typedef struct OF_BOXABLE { OFSocketAddressFamily family; /* * We can't use struct sockaddr as it can contain variable length * arrays. */ union { struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_un un; struct sockaddr_ipx ipx; } sockaddr; socklen_t length; } OFSocketAddress; #ifdef __cplusplus extern "C" { #endif |
︙ | ︙ | |||
239 240 241 242 243 244 245 | * @param node The node in the IPX network * @param port The IPX port (sometimes called socket number) on the node * @return An IPX socket address with the specified node, network and port. */ extern OFSocketAddress OFSocketAddressMakeIPX(uint32_t network, const unsigned char node[_Nonnull IPX_NODE_LEN], uint16_t port); | < < < < < < < < < < < < | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | * @param node The node in the IPX network * @param port The IPX port (sometimes called socket number) on the node * @return An IPX socket address with the specified node, network and port. */ extern OFSocketAddress OFSocketAddressMakeIPX(uint32_t network, const unsigned char node[_Nonnull IPX_NODE_LEN], uint16_t port); /** * @brief Compares two OFSocketAddress for equality. * * @param address1 The address to compare with the second address * @param address2 The second address * @return Whether the two addresses are equal */ |
︙ | ︙ | |||
358 359 360 361 362 363 364 | * @brief Returns the IPX port of the specified @ref OFSocketAddress. * * @param address The address on which to get the port * @return The port of the address */ extern uint16_t OFSocketAddressIPXPort(const OFSocketAddress *_Nonnull address); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | * @brief Returns the IPX port of the specified @ref OFSocketAddress. * * @param address The address on which to get the port * @return The port of the address */ extern uint16_t OFSocketAddressIPXPort(const OFSocketAddress *_Nonnull address); extern bool OFSocketInit(void); #if defined(OF_HAVE_THREADS) && defined(OF_AMIGAOS) && !defined(OF_MORPHOS) extern void OFSocketDeinit(void); #endif extern int OFSocketErrNo(void); #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) extern int OFGetSockName(OFSocketHandle sock, struct sockaddr *restrict addr, |
︙ | ︙ |