Index: ossp-pkg/l2/l2_ch_pipe.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_pipe.c,v rcsdiff -q -kk '-r1.24' '-r1.25' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_pipe.c,v' 2>/dev/null --- l2_ch_pipe.c 2001/10/04 12:34:41 1.24 +++ l2_ch_pipe.c 2001/10/04 12:53:54 1.25 @@ -37,7 +37,7 @@ #define L2_PIPE_EXECMODE_DIRECT 1 /* direct command execution */ #define L2_PIPE_EXECMODE_SHELL 2 /* shell command execution */ -#define L2_PIPE_RUNTIME_RELIABLE 3 /* reliable pipe command processing */ +#define L2_PIPE_RUNTIME_CONTINU 3 /* continuous pipe command processing */ #define L2_PIPE_RUNTIME_ONESHOT 4 /* oneshot pipe command processing */ #define L2_PIPE_WRITEFAIL 6 /* how long before failure occurs */ #define L2_PIPE_MAXARGS 256 /* how many args can piped command have */ @@ -49,7 +49,7 @@ int piFd[2]; /* pipe file descriptor */ int iNulldev; /* null device file descriptor */ int iMode; /* execution mode direct or shell */ - int iRtme; /* runtime mode reliable or oneshot */ + int iRtme; /* runtime mode continuous or oneshot */ char *szCmdpath; /* path to command and arguments */ struct sigaction sigchld; /* initial state of chld signal handler */ struct sigaction sigpipe; /* initial state of pipe signal handler */ @@ -78,7 +78,7 @@ /* * The lifecycle of the command executed by the pipe channel handler * depends on the runtime option selected during configuration. The - * option 'reliable' describes subsequent behavior which rebuilds an + * option 'continuous' describes subsequent behavior which rebuilds an * (un)intentionally severed child-controlled pipe. In this case, when * the pipe handler encounters a failed write operation, it will attempt * the reconnection a user-defined number of times until failure is assumed. @@ -178,9 +178,9 @@ char *szRel = NULL; /* feed and call generic parameter parsing engine */ - L2_PARAM_SET(pa[0], execmode, CHARPTR, &szMode); /* mode direct or shell */ - L2_PARAM_SET(pa[1], runtime, CHARPTR, &szRel); /* reliable or oneshot */ - L2_PARAM_SET(pa[2], path, STRING, &cfg->szCmdpath); /* path of cmd */ + L2_PARAM_SET(pa[0], execmode, CHARPTR, &szMode); /* mode direct or shell */ + L2_PARAM_SET(pa[1], runtime, CHARPTR, &szRel); /* continuous or oneshot */ + L2_PARAM_SET(pa[2], path, STRING, &cfg->szCmdpath); /* path of cmd */ L2_PARAM_END(pa[3]); if ((rv = l2_util_setparams(pa, fmt, ap)) != L2_OK) return rv; @@ -195,9 +195,9 @@ } if (szRel != NULL) { - if (strcmp(szRel, "reliable") == 0) - cfg->iRtme = L2_PIPE_RUNTIME_RELIABLE; - else if (strcmp(szMode, "oneshot") == 0) + if (strncmp(szRel, "continuous", strlen("cont")) == 0) + cfg->iRtme = L2_PIPE_RUNTIME_CONTINU; + else if (strncmp(szMode, "oneshot", strlen("one")) == 0) cfg->iRtme = L2_PIPE_RUNTIME_ONESHOT; else return L2_ERR_ARG; Index: ossp-pkg/l2/l2_test.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_test.c,v rcsdiff -q -kk '-r1.28' '-r1.29' -u '/v/ossp/cvs/ossp-pkg/l2/l2_test.c,v' 2>/dev/null --- l2_test.c 2001/09/28 14:28:41 1.28 +++ l2_test.c 2001/10/04 12:53:54 1.29 @@ -29,12 +29,6 @@ #include -#include /* following group of includes are for */ -#include /* socket testing only */ -#include -#include /* TODO: probably can be removed */ -#include /* TODO: probably can be removed */ - #include "l2.h" static void die(char *fmt, ...) @@ -150,8 +144,11 @@ die("failed to configure pipe channel"); #endif - if (l2_channel_configure(chPipe, "mode,path", "shell", "$CRONOLOGDIR/cronolog -o $HOME/tmp/crono.log") != L2_OK) - die("failed to configure pipe channel"); + if (l2_channel_configure(chPipe, "execmode,path", "shell", "$CRONOLOGDIR/cronolog -o $HOME/tmp/crono.log") != L2_OK) + die("failed to configure pipe channel due to mode and path parameters"); + + if (l2_channel_configure(chPipe, "runtime", "continuous") != L2_OK) + die("failed to configure pipe channel due to continuous parameter"); if (l2_channel_open(chPipe) != L2_OK) die("failed to open pipe channel"); @@ -168,12 +165,12 @@ die("failed to create socket channel"); if (l2_channel_configure(chSock, "protocol,ipversion,host,port",\ - IPPROTO_TCP, AF_INET, "localhost", 2002) != L2_OK) - die("failed to configure socket ipv4 channel"); + "tcp", "ipv4", "localhost", 2002) != L2_OK) + die("failed to configure socket tcp/ipv4 channel"); #if 0 if (l2_channel_configure(chSock, "protocol,ipversion,host,port",\ - IPPROTO_TCP, AF_INET6, "0:0:0:0:0:0:0:1", 2002) != L2_OK) - die("failed to configure socket ipv6 channel"); + "tcp", "ipv6", "0:0:0:0:0:0:0:1", 2002) != L2_OK) + die("failed to configure socket tcp/ipv6 channel"); #endif if (l2_channel_open(chSock) != L2_OK) die("failed to open socket channel");