rxsock.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include "oorexxapi.h"
#include <sys/types.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "rxsock.h"
Include dependency graph for rxsock.cpp:

Go to the source code of this file.

Macros

#define PROG_DESC   "REXX function package for tcp/ip sockets"
 
#define PROG_COPY   "(c) Copyright International Business Machines Corporation 1993, 2004"
 
#define PROG_COPY1   "(c) Copyright Rexx Language Association 2005-2009"
 
#define PROG_ALRRa   "All Rights Reserved."
 
#define PROG_ALRRb   "This program and the accompanying materials"
 
#define PROG_ALRRc   "are made available under the terms of the Common Public License v1.0"
 

Functions

int caselessCompare (const char *op1, const char *op2)
 
void stripBlanks (char *string)
 
char * getStemElement (RexxCallContext *context, StemManager &stem, const char *name)
 
void stemToIntArray (RexxCallContext *context, RexxObjectPtr stemSource, int &count, int *&arr)
 
void intArrayToStem (RexxCallContext *context, RexxObjectPtr stemSource, int count, int *arr)
 
void stemToSockAddr (RexxCallContext *context, StemManager &stem, sockaddr_in *pSockAddr)
 
void sockAddrToStem (RexxCallContext *context, sockaddr_in *pSockAddr, StemManager &stem)
 
void hostEntToStem (RexxCallContext *context, struct hostent *pHostEnt, StemManager &stem)
 
int stringToSockOpt (const char *pszOptName)
 
void setErrno (RexxCallContext *context)
 
void setH_Errno (RexxCallContext *context)
 
void cleanup (RexxCallContext *context)
 
 RexxRoutine0 (RexxStringObject, SockVersion)
 
 RexxRoutine1 (CSTRING, SockLoadFuncs, OPTIONAL_CSTRING, version)
 
 RexxRoutine0 (RexxStringObject, SockDropFuncs)
 
 RexxRoutine0 (int, SockDie)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockDropFuncs)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockVersion)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockDie)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockException)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockAccept)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockBind)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockClose)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockConnect)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetHostByAddr)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetHostByName)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetHostId)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetHostName)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetPeerName)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetSockName)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockGetSockOpt)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockInit)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockIoctl)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockListen)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockPSock_Errno)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockRecv)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockRecvFrom)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSelect)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSend)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSendTo)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSetSockOpt)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockShutDown)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSock_Errno)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSocket)
 
 REXX_TYPED_ROUTINE_PROTOTYPE (SockSoClose)
 
 OOREXX_GET_PACKAGE (rxsock)
 

Variables

RexxRoutineEntry rxsock_functions []
 
RexxPackageEntry rxsock_package_entry
 

Macro Definition Documentation

◆ PROG_ALRRa

#define PROG_ALRRa   "All Rights Reserved."

Definition at line 53 of file rxsock.cpp.

◆ PROG_ALRRb

#define PROG_ALRRb   "This program and the accompanying materials"

Definition at line 54 of file rxsock.cpp.

◆ PROG_ALRRc

#define PROG_ALRRc   "are made available under the terms of the Common Public License v1.0"

Definition at line 55 of file rxsock.cpp.

◆ PROG_COPY

#define PROG_COPY   "(c) Copyright International Business Machines Corporation 1993, 2004"

Definition at line 51 of file rxsock.cpp.

◆ PROG_COPY1

#define PROG_COPY1   "(c) Copyright Rexx Language Association 2005-2009"

Definition at line 52 of file rxsock.cpp.

◆ PROG_DESC

#define PROG_DESC   "REXX function package for tcp/ip sockets"

Definition at line 50 of file rxsock.cpp.

Function Documentation

◆ caselessCompare()

int caselessCompare ( const char *  op1,
const char *  op2 
)

Definition at line 108 of file rxsock.cpp.

Referenced by RexxRoutine3(), RexxRoutine4(), RexxRoutine5(), stemToSockAddr(), and stringToSockOpt().

◆ cleanup()

void cleanup ( RexxCallContext context)

◆ getStemElement()

char* getStemElement ( RexxCallContext context,
StemManager stem,
const char *  name 
)

Definition at line 156 of file rxsock.cpp.

References StemManager::getValue(), and NULLOBJECT.

Referenced by stemToSockAddr().

◆ hostEntToStem()

void hostEntToStem ( RexxCallContext context,
struct hostent *  pHostEnt,
StemManager stem 
)

Definition at line 364 of file rxsock.cpp.

References StemManager::setValue().

Referenced by RexxRoutine2(), and RexxRoutine3().

◆ intArrayToStem()

void intArrayToStem ( RexxCallContext context,
RexxObjectPtr  stemSource,
int  count,
int *  arr 
)

Definition at line 232 of file rxsock.cpp.

References StemManager::resolveStem(), and StemManager::setValue().

Referenced by RexxRoutine4().

◆ OOREXX_GET_PACKAGE()

OOREXX_GET_PACKAGE ( rxsock  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [1/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockAccept  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [2/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockBind  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [3/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockClose  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [4/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockConnect  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [5/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockDie  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [6/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockDropFuncs  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [7/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockException  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [8/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetHostByAddr  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [9/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetHostByName  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [10/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetHostId  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [11/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetHostName  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [12/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetPeerName  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [13/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetSockName  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [14/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockGetSockOpt  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [15/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockInit  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [16/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockIoctl  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [17/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockListen  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [18/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockPSock_Errno  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [19/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockRecv  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [20/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockRecvFrom  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [21/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSelect  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [22/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSend  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [23/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSendTo  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [24/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSetSockOpt  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [25/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockShutDown  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [26/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSock_Errno  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [27/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSocket  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [28/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockSoClose  )

◆ REXX_TYPED_ROUTINE_PROTOTYPE() [29/29]

REXX_TYPED_ROUTINE_PROTOTYPE ( SockVersion  )

◆ RexxRoutine0() [1/3]

RexxRoutine0 ( int  ,
SockDie   
)

Definition at line 634 of file rxsock.cpp.

◆ RexxRoutine0() [2/3]

RexxRoutine0 ( RexxStringObject  ,
SockDropFuncs   
)

Definition at line 622 of file rxsock.cpp.

◆ RexxRoutine0() [3/3]

RexxRoutine0 ( RexxStringObject  ,
SockVersion   
)

Definition at line 599 of file rxsock.cpp.

◆ RexxRoutine1()

RexxRoutine1 ( CSTRING  ,
SockLoadFuncs  ,
OPTIONAL_CSTRING  ,
version   
)

Definition at line 610 of file rxsock.cpp.

◆ setErrno()

void setErrno ( RexxCallContext context)

Definition at line 453 of file rxsock.cpp.

Referenced by cleanup().

◆ setH_Errno()

void setH_Errno ( RexxCallContext context)

Definition at line 558 of file rxsock.cpp.

Referenced by cleanup().

◆ sockAddrToStem()

void sockAddrToStem ( RexxCallContext context,
sockaddr_in pSockAddr,
StemManager stem 
)

Definition at line 343 of file rxsock.cpp.

References StemManager::setValue().

Referenced by RexxRoutine2(), and RexxRoutine5().

◆ stemToIntArray()

void stemToIntArray ( RexxCallContext context,
RexxObjectPtr  stemSource,
int &  count,
int *&  arr 
)

Definition at line 173 of file rxsock.cpp.

References StemManager::getValue(), NULLOBJECT, and StemManager::resolveStem().

Referenced by RexxRoutine4().

◆ stemToSockAddr()

void stemToSockAddr ( RexxCallContext context,
StemManager stem,
sockaddr_in pSockAddr 
)

Definition at line 261 of file rxsock.cpp.

References caselessCompare(), getStemElement(), and stripBlanks().

Referenced by RexxRoutine2(), RexxRoutine4(), and RexxRoutine5().

◆ stringToSockOpt()

int stringToSockOpt ( const char *  pszOptName)

Definition at line 422 of file rxsock.cpp.

References caselessCompare().

Referenced by RexxRoutine4().

◆ stripBlanks()

void stripBlanks ( char *  string)

Definition at line 124 of file rxsock.cpp.

Referenced by RexxRoutine3(), and stemToSockAddr().

Variable Documentation

◆ rxsock_functions

RexxRoutineEntry rxsock_functions[]

Definition at line 675 of file rxsock.cpp.

◆ rxsock_package_entry

RexxPackageEntry rxsock_package_entry
Initial value:
=
{
"RXSOCK",
"4.0",
NULL,
NULL,
NULL
}
#define REXX_INTERPRETER_4_0_0
Definition: oorexxapi.h:216
#define STANDARD_PACKAGE_HEADER
Definition: oorexxapi.h:230
RexxRoutineEntry rxsock_functions[]
Definition: rxsock.cpp:675

Definition at line 708 of file rxsock.cpp.