dispsocket_t *dispsock;
unsigned int nports;
in_port_t *ports;
- unsigned int bindoptions;
+ isc_socket_options_t bindoptions;
dispportentry_t *portentry = NULL;
dns_qid_t *qid;
* information regarding copyright ownership.
*/
-/* $Id$ */
-
#ifndef ISC_SOCKET_H
#define ISC_SOCKET_H 1
*/
#define ISC_SOCKET_MAXSCATTERGATHER 8
-/*%
- * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling
- * bind() if a non zero port is specified (AF_INET and AF_INET6).
+/*@{*/
+/*!
+ * Socket options:
+ *
+ * _REUSEADDRESS: Set SO_REUSEADDR prior to calling bind(),
+ * if a non-zero port is specified (applies to
+ * AF_INET and AF_INET6).
*/
-#define ISC_SOCKET_REUSEADDRESS 0x01U
+typedef enum {
+ ISC_SOCKET_REUSEADDRESS = 0x01U,
+} isc_socket_options_t;
+/*@}*/
/*%
* Statistics counters. Used as isc_statscounter_t values.
isc_result_t
isc_socket_bind(isc_socket_t *sock, const isc_sockaddr_t *addressp,
- unsigned int options);
+ isc_socket_options_t options);
/*%<
* Bind 'socket' to '*addressp'.
*
isc_result_t
isc__socket_bind(isc_socket_t *sock0, const isc_sockaddr_t *sockaddr,
- unsigned int options) {
+ isc_socket_options_t options)
+{
isc__socket_t *sock = (isc__socket_t *)sock0;
char strbuf[ISC_STRERRORSIZE];
int on = 1;
isc_result_t
isc__socket_bind(isc_socket_t *sock, const isc_sockaddr_t *sockaddr,
- unsigned int options) {
+ isc_socket_options_t options)
+{
int bind_errno;
char strbuf[ISC_STRERRORSIZE];
int on = 1;