File: defs.h

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (64 lines) | stat: -rw-r--r-- 1,513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef DIAMETER_DEFS 
#define  DIAMETER_DEFS

#define vendorID	0

#define AA_REQUEST 265
#define AA_ANSWER  265

#define SERVICE_LEN  1
#define SIP_AUTHENTICATION	"6"
#define SIP_GROUP_CHECK		"8"

#define SIP_AUTH_SERVICE 	'6'
#define SIP_GROUP_SERVICE	'8'
#define SIP_ACC_SERVICE		'9'

#define AAA_CHALENGE 		 1
#define AAA_AUTHORIZED 		 0
#define AAA_NOT_AUTHORIZED	 2
#define AAA_SRVERR			 3

#define AAA_ERROR			-1
#define AAA_CONN_CLOSED		-2
#define AAA_TIMEOUT			-3
#define AAA_USER_IN_GROUP	 0	

#define AAA_NO_CONNECTION	-1

#define WWW_AUTH_CHALLENGE_LEN 		18
#define PROXY_AUTH_CHALLENGE_LEN 	20
		
#define WWW_AUTH_CHALLENGE		"WWW-Authenticate: "
#define PROXY_AUTH_CHALLENGE 	"Proxy-Authenticate: "

#define MESSAGE_401 "Unauthorized"
#define MESSAGE_407 "Proxy Authentication Required"
#define MESSAGE_400 "Bad Request"
#define MESSAGE_500 "Server Internal Error"

#define separator ","

typedef enum auth_result {
	ERROR = -2 ,		/* Error occurred, a reply has been 
						   sent out -> return 0 to the ser core */
	NO_CREDENTIALS,     /* Credentials missing   */
	DO_AUTHORIZATION,   /* Credentials included  */
	AUTHORIZED          /* Authorized by default */
} auth_result_t;

/* information needed for reading messages from tcp connection */
typedef struct rd_buf
{
	/* used to return a parsed response */
	int ret_code;
	unsigned int chall_len; 
	unsigned char *chall;

	/* used to read the message*/
	unsigned int first_4bytes;
	unsigned int buf_len;
	unsigned char *buf;
} rd_buf_t;

#endif