z/OS Communications Server: IP CICS Sockets Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Structures used in socket calls

z/OS Communications Server: IP CICS Sockets Guide
SC27-3649-00

The parameter lists for some C language socket calls include a pointer to a data structure defined by a C structure. The structures are defined in the header files in.h,, socket.h, and if.h. Table 1 shows the C structure calls.

Table 1. C structures

C structure

Format

clientid
 

struct clientid {
   int       domain;
   char      name[8];
   char      subtaskname[8];    
   char      reserved[20];
};

ifconf
 
Used in the ioctl()
call only

struct   ifconf {
    int  ifc_len;
    union {
    caddr_t   ifcu_buf;
    struct    ifreq *ifcu_req;
    } ifc_ifcu;
};

ifreq
 
Used in the ioctl() call only

struct   ifreq {
#define  IFNAMSIZ  16
    char    ifr_name[IFNAMSIZ];
    union {
    struct  sockaddr ifru_addr;
    struct  sockaddr ifru_dstaddr;
    struct  sockaddr ifru_broadaddr;
    short   ifru_flags;
    int     ifru_metric;
    caddr_t ifru_data;
    } ifr_ifru;
};

NetConfHdr

 
Used in the ioctl()  call only

struct HomeIf { 
struct in6_addr HomeIfAddress;
}; 
struct NetConfHdr {          
       char     NchEyeCatcher[4];
       uint32_t NchIOCTL;
       int32_t  NchBufferLength;
       union {
         struct HomeIf * __ptr32 NchIfHome;
         struct GRT6RtEntry * __ptr32 
              NchGRT6RtEntry;
         } NchBufferPtr;
         int32_t  NchNumEntryRet;
};

If_NameIndex

 
Used in the
if_freenameindex(),
if_indextoname(),
if_nameindex(),
and if_nametoindex() calls

struct if_nameindex { 
unsigned int if_index; 
char * if_name;
}; 

linger
 
Used in the
getsockopt() and setsockopt()
calls only

struct  linger {
    int     l_onoff;
    int     l_linger;
};

ip_mreq
 
Used in the
setsockopt()
call only

struct ip_mreq {
            struct in_addr imr_multiaddr;
            struct in_addr imr_interface;
};

ipv6_mreq
 
Used in the
setsockopt() call only

struct ipv6_mreq {
      struct in6_addr ipv6mr_multiaddr;
      unsigned int ipv6mr_interface;
};

sockaddr_in
 

struct in_addr
{
        unsigned long s_addr;
};
struct sockaddr_in {
    short   sin_family;
    ushort  sin_port;
    struct  in_addr sin_addr;
    char    sin_zero[8];
};

sockaddr_in6

 

struct in6_addr {            
      union {                    
        uint8_t  _S6_u8[16];     
        uint32_t _S6_u32[4];     
      } _S6_un;                  
    };                           
    struct sockaddr_in6 {           
     uint8_t         sin6_len;     
     sa_family_t     sin6_family;  
     in_port_t       sin6_port;    
     uint32_t        sin6_flowinfo;
     struct in6_addr sin6_addr;    
     uint32_t        sin6_scope_id;
};                              

addrinfo

 

Use in the getaddrinfo()

and freeaddrinfo() calls

struct addrinfo {
       int              ai_flags;       
       int              ai_family;       
       int              ai_socktype;       
       int              ai_protocol;       
       socklen_t        ai_addrlen;       
       char            *ai_canonname;       
       struct sockaddr *ai_addr;       
       struct addrinfo *ai_next;
       int              ai_eflags;  
};

timeval
 

Use in the getsockopt(),

select(), and

setsockopt() calls

struct timeval {
    time_t tv_sec;   
    long   tv_usec;
};

ip_mreq_source
 
Used in the setsockopt()
call only

struct ip_mreq_source { 
    struct in_addr imr_multiaddr; 
    struct in_addr imr_sourceaddr; 
struct in_addr imr_interface; 
}; 

group_req
 
Used in the setsockopt()
call only

struct group_req { 
   uint32_t gr_interface; 
   uint32_t __gr_01; 
   struct sockaddr_storage gr_group; 
}; 

group_source_req
 
Used in the setsockopt()
call only

struct group_source_req { 
    uint32_t gsr_interface; 
    uint32_t __gsr_01; 
    struct sockaddr_storage gsr_group; 
    struct sockaddr_storage gsr_source; 
}; 

SetApplData
 

Used in the

SIOCSAPPLDATA ioctl() call

#define SetAD_eye1 "SETAPPLD" 
#define SETADVER  1

struct {
    char SetAD_eye1[8];
    short  SetAD_ver;
    short  SetAD_len;
    char   SetAD_rsv[4];
#ifndef _LP64
   int  SetAD_ptrHW;
#endif
   SetADcontainer *SetAD_ptr;
} SetApplData;

SetADcontainer
 

Used in the

SIOCSAPPLDATA ioctl() call

#define SETADEYE2 "APPLDATA"

typedef struct {
    char   SetAD_eye2[8];
    char   SetAD_buffer[40];
} SetADcontainer;

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014