2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

add isc_socket_gettype()

This commit is contained in:
Michael Graff
1999-06-25 01:36:52 +00:00
parent 4c208bd46f
commit b456d80637
2 changed files with 20 additions and 2 deletions

View File

@@ -121,8 +121,8 @@ typedef struct isc_socket_connev {
#define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 261)
typedef enum {
isc_socket_udp,
isc_socket_tcp
isc_socket_udp = 1,
isc_socket_tcp = 2
} isc_sockettype_t;
/*
@@ -597,6 +597,16 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp);
* All resources used by the manager have been freed.
*/
isc_sockettype_t
isc_socket_gettype(isc_socket_t *sock);
/*
* Returns the socket type for "sock."
*
* Requires:
*
* "sock" is a valid socket.
*/
ISC_LANG_ENDDECLS
#endif /* ISC_SOCKET_H */

View File

@@ -2823,3 +2823,11 @@ isc_socket_sendmark(isc_socket_t *sock,
return (ISC_R_SUCCESS);
}
isc_sockettype_t
isc_socket_gettype(isc_socket_t *sock)
{
REQUIRE(VALID_SOCKET(sock));
return (sock->type);
}