]> Kevux Git Server - fll/commit
Update: Re-design f_socket to better support handling of different struct sockaddr...
authorKevin Day <thekevinday@gmail.com>
Fri, 8 Dec 2023 04:46:53 +0000 (22:46 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 8 Dec 2023 04:46:53 +0000 (22:46 -0600)
commit596997daebd53246b205d0221c5c616bfafb7d23
tree3ac56277025a4159de01ef277a9f0ec3cace84cd
parentfdc1d99415cd72519c9c3ac36f5e8b69428ea0f2
Update: Re-design f_socket to better support handling of different struct sockaddr types.

The networking types are already in use, such as address family (AF_*) and protocol family (PF_*).
The known and supported socket address structures (struct sockaddr) do not directly relate to either.
Create a new enumeration that directly maps to these socket address structures (struct sockaddr), called an address form.
A 16-bit integer is hopefully more than is ever needed for this.

Rewrite f_socket_bind() and f_socket_connect() to use the socket.form enumeration.
The custom *_inet4(), *_inet6(), and *_local() functions are removed.

Add a generic, or fallback aka failsafe, type for handling the most basic socket address tructure (struct sockaddr).
14 files changed:
level_0/f_socket/c/socket.c
level_0/f_socket/c/socket.h
level_0/f_socket/c/socket/address.h
level_0/f_socket/c/socket/socket.h
level_0/f_socket/data/build/settings-tests
level_0/f_socket/tests/unit/c/test-socket-bind.c
level_0/f_socket/tests/unit/c/test-socket-bind_inet4.c [deleted file]
level_0/f_socket/tests/unit/c/test-socket-bind_inet4.h [deleted file]
level_0/f_socket/tests/unit/c/test-socket-bind_inet6.c [deleted file]
level_0/f_socket/tests/unit/c/test-socket-bind_inet6.h [deleted file]
level_0/f_socket/tests/unit/c/test-socket-bind_local.c [deleted file]
level_0/f_socket/tests/unit/c/test-socket-bind_local.h [deleted file]
level_0/f_socket/tests/unit/c/test-socket.c
level_0/f_socket/tests/unit/c/test-socket.h