Remove protocol names, instead use an enum with common protocols

The whole protocol name thing is pretty weird. The getprotobyname functions
seem to only specify one mapping for name <-> ids, so all families/types
must use the same values. Plus the values used for the protocols are
standardized by IANA, so are always the same.

So, we drop using names for protocols, intead introducing an enum with
a few commonly availible and used protocols.
This commit is contained in:
Alexander Larsson
2009-05-20 12:01:29 +02:00
parent 6d01593b06
commit 5cd86fbda6
16 changed files with 417 additions and 172 deletions

View File

@@ -76,9 +76,9 @@ void g_socket_client_set_family (GSocket
GSocketType g_socket_client_get_socket_type (GSocketClient *client);
void g_socket_client_set_socket_type (GSocketClient *client,
GSocketType type);
const char *g_socket_client_get_protocol (GSocketClient *client);
GSocketProtocol g_socket_client_get_protocol (GSocketClient *client);
void g_socket_client_set_protocol (GSocketClient *client,
const char *protocol);
GSocketProtocol protocol);
GSocketAddress *g_socket_client_get_local_address (GSocketClient *client);
void g_socket_client_set_local_address (GSocketClient *client,
GSocketAddress *address);