1bef59bc9dcbd29ec8b861e7a8b7dbc47e1ab505
[radsecproxy.git] / lib / radsecproxy / radmsg.h
1 /* Copyright (c) 2007-2008, UNINETT AS */
2 /* See LICENSE for licensing information. */
3
4 #define RAD_Access_Request 1
5 #define RAD_Access_Accept 2
6 #define RAD_Access_Reject 3
7 #define RAD_Accounting_Request 4
8 #define RAD_Accounting_Response 5
9 #define RAD_Access_Challenge 11
10 #define RAD_Status_Server 12
11 #define RAD_Status_Client 13
12
13 #define RAD_Attr_User_Name 1
14 #define RAD_Attr_User_Password 2
15 #define RAD_Attr_Reply_Message 18
16 #define RAD_Attr_Vendor_Specific 26
17 #define RAD_Attr_Calling_Station_Id 31
18 #define RAD_Attr_Tunnel_Password 69
19 #define RAD_Attr_Message_Authenticator 80
20
21 #define RAD_VS_ATTR_MS_MPPE_Send_Key 16
22 #define RAD_VS_ATTR_MS_MPPE_Recv_Key 17
23
24 struct radmsg {
25     uint8_t code;
26     uint8_t id;
27     uint8_t auth[20];
28     struct list *attrs;
29 };
30
31 void radmsg_free(struct radmsg *);
32 struct radmsg *radmsg_init(uint8_t, uint8_t, uint8_t *);
33 int radmsg_add(struct radmsg *, struct tlv *);
34 struct tlv *radmsg_gettype(struct radmsg *, uint8_t);
35 uint8_t *radmsg2buf(struct radmsg *msg, uint8_t *);
36 struct radmsg *buf2radmsg(uint8_t *, uint8_t *, uint8_t *);
37
38 /* Local Variables: */
39 /* c-file-style: "stroustrup" */
40 /* End: */