2 Copyright (c) 1995-1998 by Cisco systems, Inc.
4 Permission to use, copy, modify, and distribute this software for
5 any purpose and without fee is hereby granted, provided that this
6 copyright and permission notice appear on all copies of the
7 software and supporting documentation, the name of Cisco Systems,
8 Inc. not be used in advertising or publicity pertaining to
9 distribution of the program without specific prior permission, and
10 notice be given in supporting documentation that modification,
11 copying and distribution is by permission of Cisco Systems, Inc.
13 Cisco Systems, Inc. makes no representations about the suitability
14 of this software for any purpose. THIS SOFTWARE IS PROVIDED ``AS
15 IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
16 WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS FOR A PARTICULAR PURPOSE.
20 /* Keywords of the configuration language */
31 static void *wordtable[HASH_TAB_SIZE]; /* Table of keyword declarations */
39 typedef struct keyword KEYWORD;
41 static void declare TAC_ARGS((char *name, int value));
49 KEYWORD *k = (KEYWORD *)tac_malloc(sizeof(KEYWORD));
51 k->word = tac_strdup(name);
54 n = hash_add_entry(wordtable, (void *) k);
57 report(LOG_ERR, "Attempt to multiply define keyword %s",
63 /* Declare keywords of the "configuration language". */
65 void parser_init TAC_ARGS((void));
70 bzero(wordtable, sizeof(wordtable));
72 declare("access", S_access);
73 declare("accounting", S_accounting);
74 declare("after", S_after);
75 declare("arap", S_arap);
76 declare("attribute", S_attr);
77 declare("authentication", S_authentication);
78 declare("authorization", S_authorization);
79 declare("before", S_before);
80 declare("chap", S_chap);
82 declare("ms-chap", S_mschap);
84 declare("cleartext", S_cleartext);
86 declare("pam", S_pam);
88 declare("nopassword", S_nopasswd);
89 declare("cmd", S_cmd);
90 declare("default", S_default);
91 declare("deny", S_deny);
92 declare("des", S_des);
93 declare("exec", S_exec);
94 declare("expires", S_expires);
95 declare("file", S_file);
96 declare("group", S_group);
97 declare("global", S_global);
98 declare("host", S_host);
100 declare("ipx", S_ipx);
101 declare("key", S_key);
102 declare("lcp", S_lcp);
104 declare("maxsess", S_maxsess);
108 declare("db_accounting",S_db_accounting);
111 declare ("ldap", S_ldap);
113 declare("member", S_member);
114 declare("message", S_message);
115 declare("name", S_name);
116 declare("optional", S_optional);
117 declare("login", S_login);
118 declare("permit", S_permit);
119 declare("pap", S_pap);
120 declare("opap", S_opap);
121 declare("ppp", S_ppp);
122 declare("protocol", S_protocol);
123 declare("skey", S_skey);
124 declare("slip", S_slip);
125 declare("service", S_svc);
126 declare("user", S_user);
127 declare("time", S_time);
128 declare("and", S_and);
129 declare("closeparen", S_closeparen);
130 declare("enlist", S_enlist);
131 declare("first", S_first);
132 declare("not", S_not);
133 declare("openparen", S_openparen);
135 declare("recursive", S_recursive);
136 declare("when", S_when);
139 int keycode TAC_ARGS((const char *keyword));
141 /* Return a keyword code if a keyword is recognized. 0 otherwise */
146 KEYWORD *k = hash_lookup(wordtable, keyword);
153 const char *codestring TAC_ARGS((int type));
161 return ("<unknown symbol>");
163 return ("end-of-file");
199 case S_db_accounting:
200 return ("db_accounting");
225 return ("cleartext");
231 return("nopassword");
258 case S_authentication:
259 return ("authentication");
260 case S_authorization:
261 return ("authorization");
265 return ("attribute");
269 return ("accounting");