Clean and tiddy-up files.
[tomato.git] / release / src / router / udpxy / udpxy.h
bloba5a86e64a4935e685b8da1a4b7c4bafff7375d58
1 /* @(#) common definitions for udpxy
3 * Copyright 2008-2011 Pavel V. Cherenkov (pcherenkov@gmail.com)
5 * This file is part of udpxy.
7 * udpxy is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * udpxy is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with udpxy. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef UDPXY_H_0110081654
22 #define UDPXY_H_0110081654
24 #include <sys/types.h>
26 /* application error codes
29 static const int ERR_PARAM = 1; /* invalid parameter(s) */
30 static const int ERR_REQ = 2; /* error parsing request */
31 static const int ERR_INTERNAL = 3; /* internal error */
33 static const int LQ_BACKLOG = 16; /* server backlog value */
34 static const int SRV_RLWMARK = 0; /* low watermaek on server listener socket */
36 /* max size of string with IPv4 address */
37 #define IPADDR_STR_SIZE 16
39 /* max size of string with TCP/UDP port */
40 #define PORT_STR_SIZE 6
42 /* max length of an HTTP command */
43 #define MAX_CMD_LEN 31
45 static const int ETHERNET_MTU = 1500;
47 /* socket timeouts in seconds */
48 #define RLY_SOCK_TIMEOUT 5
49 #define SRVSOCK_TIMEOUT 1
50 #define SSEL_TIMEOUT 1
52 /* time-out (sec) to hold buffered data
53 * before sending/flushing to client(s) */
54 #define DHOLD_TIMEOUT 1
56 typedef u_short flag_t;
57 #if !defined( uf_TRUE ) && !defined( uf_FALSE )
58 #define uf_TRUE ((flag_t)1)
59 #define uf_FALSE ((flag_t)0)
60 #else
61 #error uf_TRUE or uf_FALSE already defined
62 #endif
64 #ifndef MAXPATHLEN
65 #define MAXPATHLEN 1024
66 #endif
68 /* max size of string with IPv4 address */
69 #define IPADDR_STR_SIZE 16
71 #endif /* UDPXY_H_0110081654 */
73 /* __EOF__ */