summaryrefslogtreecommitdiff
path: root/ext/socket/rubysocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r--ext/socket/rubysocket.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 8144872..d049d0f 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -44,6 +44,13 @@
# include <netdb.h>
#endif
+#ifdef HAVE_NETPACKET_PACKET_H
+# include <netpacket/packet.h>
+#endif
+#ifdef HAVE_NET_ETHERNET_H
+# include <net/ethernet.h>
+#endif
+
#include <errno.h>
#ifdef HAVE_SYS_UN_H
@@ -87,6 +94,9 @@
#ifdef HAVE_UCRED_H
# include <ucred.h>
#endif
+#ifdef HAVE_NET_IF_DL_H
+# include <net/if_dl.h>
+#endif
#ifndef HAVE_TYPE_SOCKLEN_T
typedef int socklen_t;
@@ -169,6 +179,9 @@ typedef union {
#ifdef HAVE_TYPE_STRUCT_SOCKADDR_UN
struct sockaddr_un un;
#endif
+#ifdef HAVE_TYPE_STRUCT_SOCKADDR_DL
+ struct sockaddr_dl dl; /* AF_LINK */
+#endif
struct sockaddr_storage storage;
char place_holder[2048]; /* sockaddr_storage is not enough for Unix domain sockets on SunOS and Darwin. */
} union_sockaddr;
@@ -267,6 +280,9 @@ VALUE rsock_addrinfo_inspect_sockaddr(VALUE rai);
VALUE rsock_make_ipaddr(struct sockaddr *addr, socklen_t addrlen);
VALUE rsock_ipaddr(struct sockaddr *sockaddr, socklen_t sockaddrlen, int norevlookup);
VALUE rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, socklen_t));
+VALUE rsock_inspect_sockaddr(struct sockaddr *addr, socklen_t socklen, VALUE ret);
+socklen_t rsock_sockaddr_len(struct sockaddr *addr);
+VALUE rsock_sockaddr_obj(struct sockaddr *addr, socklen_t len);
int rsock_revlookup_flag(VALUE revlookup, int *norevlookup);
@@ -344,6 +360,7 @@ void rsock_init_socket_constants(void);
void rsock_init_ancdata(void);
void rsock_init_addrinfo(void);
void rsock_init_sockopt(void);
+void rsock_init_sockifaddr(void);
void rsock_init_socket_init(void);
NORETURN(void rsock_sys_fail_host_port(const char *, VALUE, VALUE));