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 */
24 static void *wordtable[HASH_TAB_SIZE]; /* Table of keyword declarations */
32 typedef struct keyword KEYWORD;
40 KEYWORD *k = (KEYWORD *)tac_malloc(sizeof(KEYWORD));
42 k->word = tac_strdup(name);
45 n = hash_add_entry(wordtable, (void *) k);
48 report(LOG_ERR, "Attempt to multiply define keyword %s",
54 /* Declare keywords of the "configuration language". */
59 bzero(wordtable, sizeof(wordtable));
61 declare("access", S_access);
62 declare("accounting", S_accounting);
63 declare("after", S_after);
64 declare("arap", S_arap);
65 declare("attribute", S_attr);
66 declare("authentication", S_authentication);
67 declare("authorization", S_authorization);
68 declare("before", S_before);
69 declare("chap", S_chap);
71 declare("ms-chap", S_mschap);
73 declare("cleartext", S_cleartext);
75 declare("pam", S_pam);
77 declare("nopassword", S_nopasswd);
78 declare("cmd", S_cmd);
79 declare("default", S_default);
80 declare("deny", S_deny);
81 declare("des", S_des);
82 declare("exec", S_exec);
83 declare("expires", S_expires);
84 declare("file", S_file);
85 declare("group", S_group);
86 declare("global", S_global);
87 declare("host", S_host);
88 declare("type", S_type);
90 declare("ipx", S_ipx);
91 declare("key", S_key);
92 declare("lcp", S_lcp);
94 declare("maxsess", S_maxsess);
98 declare("db_accounting",S_db_accounting);
101 declare ("ldap", S_ldap);
103 declare("member", S_member);
104 declare("message", S_message);
105 declare("name", S_name);
106 declare("optional", S_optional);
107 declare("login", S_login);
108 declare("permit", S_permit);
109 declare("pap", S_pap);
110 declare("opap", S_opap);
111 declare("ppp", S_ppp);
112 declare("protocol", S_protocol);
113 declare("skey", S_skey);
114 declare("slip", S_slip);
115 declare("service", S_svc);
116 declare("user", S_user);
117 declare("time", S_time);
120 /* Return a keyword code if a keyword is recognized. 0 otherwise */
125 KEYWORD *k = hash_lookup(wordtable, keyword);
138 return ("<unknown symbol>");
140 return ("end-of-file");
178 case S_db_accounting:
179 return ("db_accounting");
204 return ("cleartext");
210 return("nopassword");
237 case S_authentication:
238 return ("authentication");
239 case S_authorization:
240 return ("authorization");
244 return ("attribute");
248 return ("accounting");