Listing 4: Socloc send and receive codes
// file socloc.h #include "comcode.h" #define SL_OK SOCKET_RC_OK #define SL_VC_ERROR SOCKET_RC_VC_ERROR #define SL_ACCESS_DENIED 1 #define SL_MEMORY_FAIL 2 #define SL_INVALID_FUNCTION 3 #define SL_INTERNAL_ERROR 4 #define SL_NOT_FOUND 5 #define SL_INVALID_PARAMETER 6 #define SL_PORT_EXIST 7 #define SL_NO_SUCH_SOCLOC 8 #define SL_BAD_IP 10 #define SL_NO_INIT 11 #define SL_LOG_ALREADY_OFF 12 #define SL_LOG_ALREADY_ON 13 #define SL_LOG_ERROR 14 #define SL_NOT_A_SOCLOC_SERVER 15 #define SL_CONFIG_PARAMETER_MISSING 20 #define SL_CONFIG_UNABLE_TO_OPEN 21 #define SL_CONFIG_INTERNAL_PARSE_ERROR 22 #define SL_CONFIG_PORT_NOT_NUMERIC 23 #define SL_CONFIG_PORT_OUT_OF_RANGE 24 #define SL_CONFIG_HOST_EXIST 25 #define SL_SEND_ADD 60 #define SL_SEND_DELETE 61 #define SL_SEND_CONFIG_ADD 62 #define SL_SEND_CONFIG_DELETE 63 #define SL_SEND_FIND 64 #define SL_SEND_CONFIG_FIND 65 #define SL_SEND_FIND_LIST 66 #define SL_SEND_GET_LIST 67 #define SL_SEND_PUT_LIST 68 #define SL_SEND_CONFIG_GET_LIST 69 #define SL_SEND_CONFIG_PUT_LIST 70 #define SL_SEND_DUMP_DEBUG 71 #define SL_SEND_CONFIG_DUMP_DEBUG 72 #define SL_SEND_TERM SOCKET_SEND_TERM #define SL_SEND_STATUS SOCKET_SEND_STATUS #define SL_SEND_LOG_OFF SOCKET_SEND_LOG_OFF #define SL_SEND_LOG_ON SOCKET_SEND_LOG_ON #define SL_SEND_LOG_STATUS SOCKET_SEND_LOG_STATUS #define SL_SEND_SERVICE_NAME SOCKET_SEND_SERVICE_NAME #define SL_SEND_VERSION SOCKET_SEND_VERSION #define SL_MAXCOMMAND 32767 #define SL_LIST_DELIM '^' #define SL_SERVICE_NAME "socloc"