/*
* routines to operate on double linked circular chains
*
+ * In memoriam ICL George 3
+ *
+ * Copyright (c) 1989 Dirk Koopman
+ *
* chain_init() - initialise a chain
* chain_add() - add an item after the ref provided
* chain_delete() - delete the item
*
* $Header$
*
- * $Log$
- * Revision 1.2 2000-03-26 14:22:59 djk
- * removed some irrelevant log info
- *
- * Revision 1.1 2000/03/26 00:03:30 djk
- * first cut of client
- *
- * Revision 1.4 1998/01/02 19:39:58 djk
- * made various changes to cope with glibc
- * fixed problem with extended status in etsi_router
- *
- * Revision 1.3 1997/01/02 18:46:46 djk
- * Added conv.c from ETSI router
- * Changed qerror.c to use syslog rather than qerror.log
- * removed all the map27 stuff into a separate directory
- * added dump.c (a debugging tool for dumping frames of data)
- *
- * Revision 1.1 1996/08/08 11:33:44 djk
- * Initial revision
- *
- * Revision 1.2 1995/04/21 16:02:51 djk
- * remove rcs id
- *
- * Revision 1.1 1995/03/04 11:46:26 djk
- * Initial revision
- *
- * Revision 1.2 1995/01/24 15:09:39 djk
- * Changed Indent to Id in rcsid
- *
- * Revision 1.1 1995/01/24 15:06:28 djk
- * Initial revision
- *
- * Revision 1.3 91/03/08 13:21:56 dlp
- * changed the chain broken checks to dlpabort for dlperror
- *
- * Revision 1.2 90/09/15 22:37:39 dlp
- * checked in with -k by dirk at 91.02.20.15.53.51.
- *
- * Revision 1.2 90/09/15 22:37:39 dlp
- * *** empty log message ***
- *
- * Revision 1.1 90/09/15 22:18:23 dlp
- * Initial revision
- *
*/
#include <stdlib.h>
return p;
}
-
-
-
-
-
-
-
+/*
+ * $Log$
+ * Revision 1.3 2000-03-30 22:51:14 djk
+ * fixed connect code in client.pl so it doesn't falsely recognise /spider
+ * /src/client as a 'client' directive.
+ * Tidied up the C client a bit
+ *
+ * Revision 1.2 2000/03/26 14:22:59 djk
+ * removed some irrelevant log info
+ *
+ * Revision 1.1 2000/03/26 00:03:30 djk
+ * first cut of client
+ *
+ * Revision 1.4 1998/01/02 19:39:58 djk
+ * made various changes to cope with glibc
+ * fixed problem with extended status in etsi_router
+ *
+ * Revision 1.3 1997/01/02 18:46:46 djk
+ * Added conv.c from ETSI router
+ * Changed qerror.c to use syslog rather than qerror.log
+ * removed all the map27 stuff into a separate directory
+ * added dump.c (a debugging tool for dumping frames of data)
+ *
+ * Revision 1.1 1996/08/08 11:33:44 djk
+ * Initial revision
+ *
+ * Revision 1.2 1995/04/21 16:02:51 djk
+ * remove rcs id
+ *
+ * Revision 1.1 1995/03/04 11:46:26 djk
+ * Initial revision
+ *
+ * Revision 1.2 1995/01/24 15:09:39 djk
+ * Changed Indent to Id in rcsid
+ *
+ * Revision 1.1 1995/01/24 15:06:28 djk
+ * Initial revision
+ *
+ * Revision 1.3 91/03/08 13:21:56 dlp
+ * changed the chain broken checks to dlpabort for dlperror
+ *
+ * Revision 1.2 90/09/15 22:37:39 dlp
+ * checked in with -k by dirk at 91.02.20.15.53.51.
+ *
+ * Revision 1.2 90/09/15 22:37:39 dlp
+ * *** empty log message ***
+ *
+ * Revision 1.1 90/09/15 22:18:23 dlp
+ * Initial revision
+ *
+ */
#define DEFPACLEN 128
#define MAXPACLEN 236
+#define MAXCALLSIGN 9
#define DBUF 1
#define DMSG 2
myregex_t iscallreg[] = { /* regexes to determine whether this is a reasonable callsign */
{
- "^[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0
+ "^[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0 /* G1TLH G1TLH1 */
},
{
- "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0 /* 2E0AAA 2E0AAA1 */
},
{
- "^[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0
+ "^[A-Z]+[0-9]+[A-Z]+-[1-9]$", 0 /* G1TLH-2 */
},
{
- "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+-[1-9]$", 0 /* 2E0AAA-2 */
},
{
- "^[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0
+ "^[A-Z]+[0-9]+[A-Z]+-1[0-5]$", 0 /* G1TLH-11 */
},
{
- "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+-1[0-5]$", 0 /* 2E0AAA-11 */
},
{
0, 0
int iscallsign(char *s)
{
myregex_t *rp;
+
+ if (strlen(s) > MAXCALLSIGN)
+ return 0;
+
for (rp = iscallreg; rp->in; ++rp) {
if (regexec(rp->regex, s, 0, 0, 0) == 0)
return 1;
f->obuf = mp = cmsg_new(paclen+1, f->sort, f);
}
- /* ignore trailing spaces */
+ /* remove trailing spaces */
while (l > 0 &&isspace(s[l-1]))
--l;