mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 08:35:31 +00:00
add isc_socket_gettype()
This commit is contained in:
@@ -121,8 +121,8 @@ typedef struct isc_socket_connev {
|
|||||||
#define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 261)
|
#define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 261)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
isc_socket_udp,
|
isc_socket_udp = 1,
|
||||||
isc_socket_tcp
|
isc_socket_tcp = 2
|
||||||
} isc_sockettype_t;
|
} isc_sockettype_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -597,6 +597,16 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp);
|
|||||||
* All resources used by the manager have been freed.
|
* 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
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_SOCKET_H */
|
#endif /* ISC_SOCKET_H */
|
||||||
|
@@ -2823,3 +2823,11 @@ isc_socket_sendmark(isc_socket_t *sock,
|
|||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isc_sockettype_t
|
||||||
|
isc_socket_gettype(isc_socket_t *sock)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_SOCKET(sock));
|
||||||
|
|
||||||
|
return (sock->type);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user