Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Functions | Variables
option.c File Reference
#include "rubysocket.h"

Go to the source code of this file.

Macros

#define pack_var(v)   rb_str_new((const char *)&(v), sizeof(v))
 
#define CAT(x, y)   x##y
 
#define XCAT(x, y)   CAT(x,y)
 
#define TYPE_IP_MULTICAST_LOOP   byte
 
#define TYPE_IP_MULTICAST_TTL   byte
 
#define USE_INSPECT_BYTE   1
 
#define check_size(len, size)
 
#define inspect_ipv4_multicast_loop(a, b, c, d)   XCAT(inspect_,TYPE_IP_MULTICAST_LOOP)(a,b,c,d)
 
#define inspect_ipv4_multicast_ttl(a, b, c, d)   XCAT(inspect_,TYPE_IP_MULTICAST_TTL)(a,b,c,d)
 
#define IFNAMSIZ   (sizeof(unsigned int)*3+1)
 

Functions

VALUE rsock_sockopt_new (int family, int level, int optname, VALUE data)
 
const char * inet_ntop (int af, const void *addr, char *numaddr, size_t numaddr_len)
 
void rsock_init_sockopt (void)
 

Variables

VALUE rb_cSockOpt
 

Macro Definition Documentation

◆ CAT

#define CAT (   x,
 
)    x##y

Definition at line 7 of file option.c.

◆ check_size

#define check_size (   len,
  size 
)
Value:
((len) == (size) ? \
(void)0 : \
rb_raise(rb_eTypeError, "size differ. expected as "#size"=%d but %ld", \
(int)size, (long)(len)))
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:2284
VALUE rb_eTypeError
Definition: error.c:801
register unsigned int len
Definition: zonetab.h:51
int size
Definition: encoding.c:57

Definition at line 30 of file option.c.

◆ IFNAMSIZ

#define IFNAMSIZ   (sizeof(unsigned int)*3+1)

Referenced by rsock_inspect_sockaddr().

◆ inspect_ipv4_multicast_loop

#define inspect_ipv4_multicast_loop (   a,
  b,
  c,
 
)    XCAT(inspect_,TYPE_IP_MULTICAST_LOOP)(a,b,c,d)

Definition at line 430 of file option.c.

◆ inspect_ipv4_multicast_ttl

#define inspect_ipv4_multicast_ttl (   a,
  b,
  c,
 
)    XCAT(inspect_,TYPE_IP_MULTICAST_TTL)(a,b,c,d)

Definition at line 481 of file option.c.

◆ pack_var

#define pack_var (   v)    rb_str_new((const char *)&(v), sizeof(v))

Definition at line 5 of file option.c.

◆ TYPE_IP_MULTICAST_LOOP

#define TYPE_IP_MULTICAST_LOOP   byte

Definition at line 25 of file option.c.

◆ TYPE_IP_MULTICAST_TTL

#define TYPE_IP_MULTICAST_TTL   byte

Definition at line 26 of file option.c.

◆ USE_INSPECT_BYTE

#define USE_INSPECT_BYTE   1

Definition at line 27 of file option.c.

◆ XCAT

#define XCAT (   x,
 
)    CAT(x,y)

Definition at line 8 of file option.c.

Function Documentation

◆ inet_ntop()

const char* inet_ntop ( int  af,
const void *  addr,
char *  numaddr,
size_t  numaddr_len 
)

Definition at line 651 of file option.c.

References snprintf.

◆ rsock_init_sockopt()

void rsock_init_sockopt ( void  )

Definition at line 1438 of file option.c.

References rb_cObject, rb_cSocket, rb_cSockOpt, rb_define_class_under(), and rb_define_method().

Referenced by rsock_init_socket_init().

◆ rsock_sockopt_new()

VALUE rsock_sockopt_new ( int  family,
int  level,
int  optname,
VALUE  data 
)

Definition at line 107 of file option.c.

References NEWOBJ_OF, rb_cSockOpt, StringValue, and T_OBJECT.

Variable Documentation

◆ rb_cSockOpt

VALUE rb_cSockOpt

Definition at line 3 of file option.c.

Referenced by rsock_init_sockopt(), and rsock_sockopt_new().