⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config_parse.c

📁 sock protocol ,it is useful!
💻 C
📖 第 1 页 / 共 4 页
字号:
#ifndef lint/*static char yysccsid[] = "from: @(#)yaccpar	1.9 (Berkeley) 02/21/93";*/static char yyrcsid[]#if __GNUC__ == 2  __attribute__ ((unused))#endif /* __GNUC__ == 2 */  = "$OpenBSD: skeleton.c,v 1.13 1998/11/18 15:45:12 dm Exp $";#endif#include <stdlib.h>#define YYBYACC 1#define YYMAJOR 1#define YYMINOR 9#define YYLEX yylex()#define YYEMPTY -1#define yyclearin (yychar=(YYEMPTY))#define yyerrok (yyerrflag=0)#define YYRECOVERING() (yyerrflag!=0)#define yyparse socks_yyparse#define yylex socks_yylex#define yyerror socks_yyerror#define yychar socks_yychar#define yyval socks_yyval#define yylval socks_yylval#define yydebug socks_yydebug#define yynerrs socks_yynerrs#define yyerrflag socks_yyerrflag#define yyss socks_yyss#define yysslim socks_yysslim#define yyssp socks_yyssp#define yyvs socks_yyvs#define yyvsp socks_yyvsp#define yystacksize socks_yystacksize#define yylhs socks_yylhs#define yylen socks_yylen#define yydefred socks_yydefred#define yydgoto socks_yydgoto#define yysindex socks_yysindex#define yyrindex socks_yyrindex#define yygindex socks_yygindex#define yytable socks_yytable#define yycheck socks_yycheck#define yyname socks_yyname#define yyrule socks_yyrule#define YYPREFIX "socks_yy"#line 45 "config_parse.y"#include "common.h"#include "yacconfig.h"static const char rcsid[] ="$Id: config_parse.y,v 1.121 1999/12/22 09:29:23 karls Exp $";__BEGIN_DECLS#if HAVE_LIBWRAP && SOCKS_SERVER	extern jmp_buf tcpd_buf;#endif /* HAVE_LIBWRAP && SOCKS_SERVER */static voidaddressinit __P((struct ruleaddress_t *address));__END_DECLSextern int yylineno;extern char *yytext;#if SOCKS_SERVERstatic struct rule_t				ruleinit;static struct rule_t				rule;				/* new rule.							*/static struct protocol_t		protocolmem;	/* new protocolmem.					*/struct linkedname_t				**userbase;		/* users rule applies to.			*/#endif#if SOCKS_CLIENTstatic struct serverstate_t	state;static struct route_t			route;			/* new route.							*/static struct ruleaddress_t	gw;				/* new gateway.						*/#endifstatic struct ruleaddress_t	src;				/* new src.								*/static struct ruleaddress_t	dst;				/* new dst.								*/static struct ruleaddress_t	*ruleaddress;	/* current ruleaddress				*/static struct extension_t		*extension;		/* new extensions						*/static struct proxyprotocol_t	*proxyprotocol;/* proxy protocol.					*/static char							*atype;			/* atype of new address.			*/static struct in_addr			*ipaddr;			/* new ipaddress						*/static struct in_addr			*netmask;		/* new netmask							*/static char							*domain;			/* new domain.							*/static in_port_t					*port_tcp;		/* new tcp portnumber.				*/static in_port_t					*port_udp;		/* new udp portnumber.				*/static int							*methodv;		/* new authmethods.					*/static int							*methodc;		/* number of them.					*/static struct protocol_t		*protocol;		/* new protocol.						*/static struct command_t			*command;		/* new command.						*/static enum operator_t			*operator;		/* new operator.						*/static const struct {	const char *name;	const int value;} syslogfacility[] = {#ifdef LOG_AUTH	{ "auth",	LOG_AUTH		},#endif /* LOG_AUTH */#ifdef LOG_AUTHPRIV	{ "authpriv",	LOG_AUTHPRIV		},#endif /* LOG_AUTHPRIV */#ifdef LOG_DAEMON	{ "daemon",	LOG_DAEMON	},#endif /* LOG_DAEMON */#ifdef LOG_USER	{ "user",	LOG_USER		},#endif /* LOG_USER */#ifdef LOG_LOCAL0	{ "local0",	LOG_LOCAL0	},#endif /* LOG_LOCAL0 */#ifdef LOG_LOCAL1	{ "local1",	LOG_LOCAL1	},#endif /* LOG_LOCAL1 */#ifdef LOG_LOCAL2	{ "local2",	LOG_LOCAL2	},#endif /* LOG_LOCAL2 */#ifdef LOG_LOCAL3	{ "local3",	LOG_LOCAL3	},#endif /* LOG_LOCAL3 */#ifdef LOG_LOCAL4	{ "local4",	LOG_LOCAL4	},#endif /* LOG_LOCAL4 */#ifdef LOG_LOCAL5	{ "local5",	LOG_LOCAL5	},#endif /* LOG_LOCAL5 */#ifdef LOG_LOCAL6	{ "local6",	LOG_LOCAL6	},#endif /* LOG_LOCAL6 */#ifdef LOG_LOCAL7	{ "local7",	LOG_LOCAL7	}#endif /* LOG_LOCAL7 */};#define YYDEBUG 1#define ADDMETHOD(method) \	do { \		if (*methodc >= AUTHMETHOD_MAX)	\			yyerror("internal error or duplicate methods given");	\		methodv[(*methodc)++] = method; \	} while (0)#line 155 "config_parse.y"typedef union {	char	*string;	uid_t	uid;} YYSTYPE;#line 160 "y.tab.c"#define SERVERCONFIG 257#define CLIENTCONFIG 258#define DEPRECATED 259#define CLIENTRULE 260#define INTERNAL 261#define EXTERNAL 262#define DEBUGING 263#define RESOLVEPROTOCOL 264#define SRCHOST 265#define NOMISMATCH 266#define NOUNKNOWN 267#define EXTENSION 268#define BIND 269#define PRIVILEGED 270#define IOTIMEOUT 271#define CONNECTTIMEOUT 272#define METHOD 273#define NONE 274#define GSSAPI 275#define UNAME 276#define RFC931 277#define COMPATIBILITY 278#define REUSEADDR 279#define SAMEPORT 280#define USERNAME 281#define USER_PRIVILEGED 282#define USER_UNPRIVILEGED 283#define USER_LIBWRAP 284#define LOGOUTPUT 285#define LOGFILE 286#define ROUTE 287#define VIA 288#define VERDICT_BLOCK 289#define VERDICT_PASS 290#define PROTOCOL 291#define PROTOCOL_TCP 292#define PROTOCOL_UDP 293#define PROTOCOL_FAKE 294#define PROXYPROTOCOL 295#define PROXYPROTOCOL_SOCKS_V4 296#define PROXYPROTOCOL_SOCKS_V5 297#define PROXYPROTOCOL_MSPROXY_V2 298#define USER 299#define COMMAND 300#define COMMAND_BIND 301#define COMMAND_CONNECT 302#define COMMAND_UDPASSOCIATE 303#define COMMAND_BINDREPLY 304#define COMMAND_UDPREPLY 305#define ACTION 306#define LINE 307#define LIBWRAPSTART 308#define OPERATOR 309#define LOG 310#define LOG_CONNECT 311#define LOG_DATA 312#define LOG_DISCONNECT 313#define LOG_ERROR 314#define LOG_IOOPERATION 315#define IPADDRESS 316#define DOMAIN 317#define DIRECT 318#define PORT 319#define PORTNUMBER 320#define SERVICENAME 321#define NUMBER 322#define FROM 323#define TO 324#define YYERRCODE 256short socks_yylhs[] = {                                        -1,    0,    0,   45,    1,    1,    1,    1,    1,    2,    2,    2,    2,   22,   23,   23,   46,   46,   46,   46,   46,   46,   46,   44,   44,   44,   44,   44,   44,    3,   52,   21,    7,    8,    8,    8,    9,    9,   10,   11,   12,   12,   28,   29,   30,   30,   31,   32,   33,   34,   24,   24,   24,   35,   36,   37,   37,   47,   47,   47,   48,   49,   50,   51,   26,   27,   25,   38,   39,   39,   40,   40,   13,   14,   14,   14,   15,   16,   16,   17,   17,   41,   43,   43,   43,   43,   42,   42,   60,   61,   61,   61,   62,   62,   57,   58,   58,   58,   58,   58,   58,   58,   59,   59,   63,   63,   18,   20,   20,   20,   20,   20,   19,   19,    4,    6,    6,    5,    5,   64,   65,   67,   67,   67,   67,   67,   66,   66,   68,   69,   70,   54,   55,   55,   55,   55,   55,   56,   56,   76,   77,   53,   71,   71,   73,   73,   73,   72,   78,   78,   74,   75,   79,   79,   79,   83,   83,   80,   81,   84,   85,   82,};short socks_yylen[] = {                                         2,    2,    2,    1,    0,    2,    2,    2,    2,    0,    2,    2,    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    8,    0,    3,    1,    1,    1,    1,    2,    3,    1,    1,    2,    3,    1,    1,    2,    5,    0,    4,    0,    1,    1,    1,    3,    1,    1,    2,    1,    1,    1,    3,    3,    3,    1,    3,    3,    3,    3,    1,    1,    1,    2,    3,    1,    1,    1,    3,    1,    1,    1,    2,    3,    1,    1,    1,    1,    1,    2,    7,    1,    1,    1,    0,    2,    6,    1,    1,    1,    1,    1,    1,    1,    0,    2,    1,    1,    3,    1,    1,    1,    1,    1,    1,    2,    3,    1,    1,    1,    2,    2,    3,    1,    1,    1,    1,    1,    1,    2,    3,    3,    3,    3,    1,    1,    1,    1,    1,    0,    2,    1,    1,    1,    4,    2,    2,    2,    1,    1,    1,    1,    1,    1,    0,    3,    2,    1,    1,    3,    1,    1,    1,    1,};short socks_yydefred[] = {                                      0,    3,   13,    0,    9,    4,    0,    0,   29,    0,    0,    0,   31,   10,   15,   52,   11,   14,   51,   50,   12,    0,   47,   49,    0,    0,    0,    0,    0,    0,    0,    0,    0,  104,  105,    5,   17,   27,   28,   26,   24,   25,   18,   19,   20,   23,   16,   21,    6,   22,   57,   58,   59,    8,    7,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   66,   74,   75,   73,   72,   54,    0,   53,    0,    0,    0,    0,   77,   78,    0,   76,   43,    0,   42,   64,   65,   82,   83,   84,   85,   81,    0,   68,   69,    0,   67,   63,   60,   61,   62,    0,    0,    0,    0,    0,    0,   99,  100,  101,   96,   95,    0,    0,   98,   97,   56,  134,  135,  132,  133,  136,    0,    0,   91,    0,    0,   90,   89,  147,    0,   48,   80,   45,   87,   71,    0,    0,    0,    0,    0,    0,  103,  139,    0,    0,    0,  138,    0,   93,    0,    0,   46,  115,  116,  114,    0,   33,   34,   35,    0,   32,   39,    0,   38,  107,  108,  109,  110,  111,  106,    0,  128,  121,  122,  123,  124,  125,  120,    0,    0,  140,  119,    0,    0,  141,    0,    0,    0,  161,  158,  154,    0,    0,  118,   37,   41,  113,  127,   94,    0,  150,  129,    0,    0,    0,    0,   88,    0,  159,  156,  153,  155,  130,    0,  143,  151,    0,  131,    0,  146,   30,  160,  157,  149,  148,    0,  144,  145,  142,};short socks_yydgoto[] = {                                       3,    7,    6,   14,  114,  162,  163,  115,  167,  168,  116,  170,  171,   15,   77,   38,   87,   88,  117,  177,  178,   59,    4,   16,   17,   18,   39,   40,  127,   90,   91,   42,   61,   43,   62,   19,   79,   80,   45,  102,  103,  118,   98,   99,   47,    5,   48,   49,   50,   51,   52,  105,   20,  193,  194,  129,  130,   53,  119,  120,   54,  132,  133,   55,  151,  121,  185,  186,  122,  152,  189,  209,  210,  225,  211,  227,  153,  190,  233,  159,  198,  199,  200,  218,  219,  230,};short socks_yysindex[] = {                                   -223,    0,    0,    0,    0,    0,  -10,  224,    0,  -30,  -19,  -17,    0,    0,    0,    0,    0,    0,    0,    0,    0, -238,    0,    0,  -15,  -12,   -9,    3,    5,    9,   12,   18,   32,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  -28, -208, -235, -167,   -3,   -1,   63,   66, -174, -142, -188, -187, -195, -206, -152, -152, -152, -255,    0,    0,    0,    0,    0,    0, -167,    0, -258, -278, -180, -180,    0,    0, -174,    0,    0, -142,    0,    0,    0,    0,    0,    0,    0,    0, -195,    0,    0, -206,    0,    0,    0,    0,    0,   79,   81,   82,   83,   84,   85,    0,    0,    0,    0,    0, -255, -179,    0,    0,    0,    0,    0,    0,    0,    0, -258, -179,    0, -278, -179,    0,    0,    0, -173,    0,    0,    0,    0,    0, -182, -193, -136, -216, -160, -213,    0,    0, -255, -176,   91,    0, -135,    0, -278, -282,    0,    0,    0,    0, -182,    0,    0,    0, -193,    0,    0, -136,    0,    0,    0,    0,    0,    0,    0, -216,    0,    0,    0,    0,    0,    0,    0, -213,   27,    0,    0,   97, -204,    0,  100, -258,   29,    0,    0,    0,  114, -205,    0,    0,    0,    0,    0,    0, -204,    0,    0,  116, -173, -209,   36,    0, -156,    0,    0,    0,    0,    0, -291,    0,    0, -173,    0, -173,    0,    0,    0,    0,    0,    0, -173,    0,    0,    0,};short socks_yyrindex[] = {                                      0,    0,    0,    0,    0,    0,  166,  167,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, -154,    0,    0,    0,    0,    0,    0,   96,    0, -150, -148,    0,    0,    0,    0,  128,    0,    0,   54,    0,    0,    0,    0,    0,    0,    0,    0,    1,    0,    0,  160,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, -120,    0,    0,    0,    0,    0,    0,    0,    0,    0, -119,    0,    0, -118,    0,    0,    0,    0,  192,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   46,    0,    0,    0,    0,    0,   56,    0,    0,    0,    0,    0, -117,    0,    0,    0, -111,    0,    0,  -75,    0,    0,    0,    0,    0,    0,    0,  -78,    0,    0,    0,    0,    0,    0,    0,   -2,    0,    0,    0,    0,    0,    0,    0,   61,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, -123,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  -54,    0,  -54,    0,    0,    0,    0,    0,    0, -123,    0,    0,    0,};short socks_yygindex[] = {                                      0,    0,    0,  187,  -69,   37,    0,  -64,    0,   40,  -66,    0,   38,  202,    0,    0,    0,  123,  -61,   33,    0,    0,    0,    0,    0,    0,    0,    0,  208,    0,  133,    0,    0,    0,    0,  211,    0,  147,    0,    0,  125,    2,  129,    0,    0,    0,    0,    0,    0,    0,    0,   47,    0,    0,    0,    0, -116,    0,    0,  -95,    0,    0, -109,  210, -104,  -63,   43,    0,  -60,    0,    0,   31,  -80,    0,   24,    0,    0,    0,    0, -149,    0,   39,    0,    0,    0,    0,};#define YYTABLESIZE 514short socks_yytable[] = {                                      13,   86,  152,  137,  138,  102,  137,   92,  117,   46,   25,   86,  124,  154,   36,   28,  131,  125,   28,  134,  126,  110,  135,  156,  149,  231,  155,  196,   56,  157,  112,  232,  113,  108,    1,    2,  108,  109,  197,   57,  109,   58,  111,   63,  110,  111,   64,  112,  195,   65,   40,   33,   34,  112,   44,  113,  187,   74,   75,   76,  124,   66,  222,   67,   44,  125,  131,   68,  126,  134,   69,  152,  135,  100,  101,  234,   70,  235,  213,   94,   95,   96,   97,  128,  236,  172,  173,  174,  175,  176,   71,  131,   85,   86,  134,   72,   55,  135,  180,  181,  182,  183,  184,  164,  165,  166,   55,  136,  208,  223,  160,  161,  136,  208,   73,  197,  216,  106,  107,   78,   81,   83,   82,  126,   84,  124,   86,   89,   79,  104,  125,  128,  224,  126,   92,   93,  136,  143,   79,  144,  145,  146,  147,  148,  150,  169,  158,  179,  188,  191,  152,  117,  206,  192,  214,  207,  117,   36,  212,  215,   70,  228,   36,  221,  229,  152,    2,    1,  152,  102,   70,  102,  152,  137,  117,   92,  152,  152,  117,   44,   36,   92,  117,  117,   36,  152,  137,  152,   36,   36,  112,  117,  152,  117,   36,  112,  128,   36,   40,   36,  201,  152,  152,  102,  137,   92,  117,  202,  203,   37,  139,  204,   36,  112,  152,   41,   40,  112,   44,  152,   40,  112,  112,  140,   40,   40,  123,  142,  141,  205,  112,   60,  112,   40,   35,   40,  226,  152,  220,  217,    0,  152,    0,    0,    0,  112,  152,    0,   40,    8,    0,    0,    0,    9,   10,    0,    0,    0,    0,    0,   86,   86,   86,   86,    0,   86,   86,    0,    0,   86,    0,  126,   86,   86,   86,   11,    0,   12,    0,   86,    0,    0,    0,   86,   86,   86,   86,    0,    0,  126,   86,   86,   86,  126,    0,    0,   86,  126,  126,    0,   86,   86,    0,    0,    0,    0,  126,    0,  126,   86,    0,   86,    0,   44,   44,   44,   44,    0,   44,   44,    0,  126,   44,    0,   86,   44,   44,   44,    0,    0,    0,    0,   44,    0,    0,    0,   44,   44,   44,   44,    0,    0,    0,   44,   44,   44,    0,    0,    0,   44,    0,    0,    0,    0,   44,   55,   55,   55,   55,   55,   55,   55,    0,    0,   55,    0,    0,   55,   55,   55,    0,    0,    0,    0,   55,    0,    0,   44,   55,   55,   55,   55,    0,   55,    0,   55,   55,   79,   79,   79,   79,    0,   79,   79,    0,    0,   79,    0,    0,   79,   79,   79,    0,    0,    0,    0,   79,    0,    0,    0,   79,   79,   79,   79,    0,    0,    0,   79,   79,   70,   70,   70,   70,    0,   70,   70,    0,    0,   70,    0,    0,   70,   70,   70,    0,    0,    0,    0,   70,    0,    0,    0,   70,   70,   70,   70,    0,    0,    0,   70,   70,  152,  152,  152,  152,    0,  152,  152,    0,    0,  152,    0,    0,  152,  152,  152,    0,    0,    0,    0,  152,    0,    0,    0,  152,  152,  152,  152,    0,    0,    0,  152,  152,    8,   21,   22,   23,    0,   10,   24,    0,    0,   25,    0,    0,   26,   27,   28,    0,    0,    0,    0,   29,    0,    0,    0,   30,   31,   32,   11,    0,    0,    0,   33,   34,};short socks_yycheck[] = {                                      10,    0,  125,   83,   84,  125,  125,  125,  125,    7,  268,   10,   81,  129,  125,  273,   82,   81,  273,   82,   81,  299,   82,  132,  119,  316,  130,  309,   58,  133,  308,  322,  310,  291,  257,  258,  291,  295,  320,   58,  295,   58,  300,   58,  299,  300,   58,  125,  157,   58,  125,  289,  290,  308,    0,  310,  151,  292,  293,  294,  129,   58,  211,   58,   10,  129,  132,   58,  129,  132,   58,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -