z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


C structures

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The parameter lists for some C language socket calls include a pointer to a data structure defined by a C structure. Table 1 shows the C structures used, and the corresponding assembler language syntax.

Table 1. C structures in assembler language format
C structure Assembler language equivalent
struct sockaddr_in
{
    short   sin_family;
    ushort  sin_port;
    struct  in_addr sin_addr;
    char    sin_zero[8];
};
FAMILY   DS    H
PORT     DS    H
ADDR     DS    F
ZERO     DC    XL8'00'
struct timeval
{
    long    tv_sec;
    long    tv_usec;
};
TVSEC    DS    F
TVUSEC   DS    F
struct  linger {
    int     l_onoff;
    int     l_linger;
};
ONOFF    DS    F
LINGER   DS    F
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;
};
NAME     DS    0CL16
ADDR.FAMILY DS    H
ADDR.PORT   DS    H
ADDR.ADDR   DS    F
ADDR.ZERO   DC    XL8'00'
         ORG   ADDR.FAMILY
DST.FAMILY  DS    H
DST.PORT    DS    H
DST.ADDR    DS    F
DST.ZERO    DC    XL8'00'
         ORG   ADDR.FAMILY
BRD.FAMILY  DS    H
BRD.PORT    DS    H
BRD.ADDR    DS    F
BRD.ZERO    DC    XL8'00'
         ORG   ADDR.FAMILY
FLAGS    DS    H
         ORG   ADDR.FAMILY
METRIC   DS    F
struct   ifconf {
    int  ifc_len;
    union {
    caddr_t   ifcu_buf;
    struct    ifreq *ifcu_req;
    } ifc_ifcu;
};
IFCLEN   DS    F
IGNORED  DS    F
struct clientid {
    int       domain;
    char      name[8];
    char      subtaskname[8];
    char      reserved[20];
};
DOMAIN   DS    F
NAME     DS    CL8
SUBTASK  DS    CL8
RESERVED DC    XL20'00'

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014