|
|
1.1 root 1: /* sys_tai.c - System tailoring routines */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/dsap/common/RCS/sys_tai.c,v 7.0 89/11/23 21:47:48 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/dsap/common/RCS/sys_tai.c,v 7.0 89/11/23 21:47:48 mrose Rel $
9: *
10: *
11: * $Log: sys_tai.c,v $
12: * Revision 7.0 89/11/23 21:47:48 mrose
13: * Release 6.0
14: *
15: */
16:
17: /* NOTICE
18: *
19: * Acquisition, use, and distribution of this module and related
20: * materials are subject to the restrictions of a license agreement.
21: * Consult the Preface in the User's Manual for the full terms of
22: * this agreement.
23: *
24: */
25:
26:
27: /* LINTLIBRARY */
28:
29: #include "quipu/util.h"
30: #include "cmd_srch.h"
31: #include "tailor.h"
32:
33: extern char *oidtable,
34: *dsa_address,
35: *local_dit,
36: dishinit,
37: *myname;
38:
39: extern LLog *log_dsap;
40: #ifndef NO_STATS
41: extern LLog * log_stat;
42: #endif
43:
44: extern int oidformat,sizelimit,timelimit;
45:
46:
47: #define SYSLOG 2
48: #define OIDTAB 4
49: #define OIDFMT 5
50: #define SIZELIMIT 12
51: #define STATS 13
52: #define TIMELIMIT 14
53: #define DSAADDR 18
54: #define PHOTO 19
55: #define LOCAL_DIT 20
56: #define DISH_INIT 21
57:
58: static CMD_TABLE cmdtab[] =
59: {
60: "DSAPLOG", SYSLOG,
61: "OIDTABLE", OIDTAB,
62: "OIDFORMAT", OIDFMT,
63: "SIZELIMIT", SIZELIMIT,
64: "TIMELIMIT", TIMELIMIT,
65: "DSA_ADDRESS", DSAADDR,
66: "PHOTO", PHOTO,
67: "LOCAL_DIT", LOCAL_DIT,
68: "QUIPURC", DISH_INIT,
69: #ifndef NO_STATS
70: "STATS", STATS,
71: #endif
72: 0, -1,
73: };
74:
75: static CMD_TABLE oidtab[] =
76: {
77: "SHORT", 1,
78: "LONG", 2,
79: "NUMERIC", 3,
80: 0, 1, /* default short */
81: };
82:
83:
84: /*
85: * do system wide initialisations
86: */
87:
88: dsap_tai (argc, argv)
89: char **argv;
90: {
91: char *arg, *term;
92: extern char * getenv ();
93: short str2syntax ();
94:
95: if(argc < 2)
96: return(NOTOK);
97:
98: arg = argv[1];
99:
100: switch(cmd_srch(argv[0], cmdtab))
101: {
102: case SYSLOG:
103: DLOG (log_dsap,LLOG_DEBUG,( "Tailor SYSLOG %s", arg));
104: log_tai(log_dsap, &argv[1], argc-1);
105: break;
106: #ifndef NO_STATS
107: case STATS:
108: DLOG (log_dsap,LLOG_DEBUG,( "Tailor STATS %s", arg));
109: log_tai(log_stat, &argv[1], argc-1);
110: break;
111: #endif
112: case OIDTAB:
113: DLOG (log_dsap,LLOG_DEBUG,( "Tailor OIDTable=%s", arg));
114: oidtable = strdup (arg);
115: break;
116: case LOCAL_DIT:
117: DLOG (log_dsap,LLOG_DEBUG,( "Tailor local_DIT=%s", arg));
118: local_dit = strdup (arg);
119: break;
120: case OIDFMT:
121: DLOG (log_dsap,LLOG_DEBUG,( "Tailor OIDFMT=%s", arg));
122: oidformat = cmd_srch (arg,oidtab);
123: break;
124: case SIZELIMIT:
125: sizelimit = atoi (arg);
126: break;
127: case TIMELIMIT:
128: timelimit = atoi (arg);
129: break;
130: case DISH_INIT:
131: if (lexequ (arg,"on") == 0)
132: dishinit = TRUE;
133: break;
134: case PHOTO:
135: DLOG (log_dsap,LLOG_DEBUG,( "Tailor photo=%s", arg));
136: if ((term = getenv ("TERM")) && strcmp (term, arg) == 0) {
137: if (*argv[2] == '/')
138: set_av_pe_print (str2syntax("photo"),strdup(argv[2]));
139: else {
140: char proc [LINESIZE];
141: (void) strcpy (proc,isodefile("g3fax/", 1));
142: (void) strcat (proc,argv[2]);
143: set_av_pe_print (str2syntax("photo"),strdup(proc));
144: }
145: }
146: break;
147: case DSAADDR:
148: if (myname == NULLCP) {
149: /* use first 'dsa_address' in tailor file */
150: DLOG (log_dsap,LLOG_DEBUG,( "Tailor DSA_ADDRESS=%s", argv[2]));
151: dsa_address = strdup (argv[2]);
152: myname = strdup (argv[1]);
153: } else if (dsa_address == NULLCP) {
154: /* User has given a '-c flag' */
155: /* look for entry in address list */
156: if (lexequ (arg,myname) == 0) {
157: DLOG (log_dsap,LLOG_DEBUG,( "Tailor DSA_ADDRESS (USER) =%s", argv[2]));
158: myname = strdup (arg);
159: dsa_address = strdup (argv[2]);
160: }
161: }
162: break;
163: default:
164: LLOG (log_dsap,LLOG_EXCEPTIONS, ("Unknown tailor option %s",arg));
165: return (NOTOK);
166: }
167: return (OK);
168: }
169:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.