Use existing temporary variable conn.
[radsecproxy.git] / radmsg.h
1 /*
2  * Copyright (C) 2006-2008 Stig Venaas <venaas@uninett.no>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  */
8
9 #define RAD_Access_Request 1
10 #define RAD_Access_Accept 2
11 #define RAD_Access_Reject 3
12 #define RAD_Accounting_Request 4
13 #define RAD_Accounting_Response 5
14 #define RAD_Access_Challenge 11
15 #define RAD_Status_Server 12
16 #define RAD_Status_Client 13
17
18 #define RAD_Attr_User_Name 1
19 #define RAD_Attr_User_Password 2
20 #define RAD_Attr_Reply_Message 18
21 #define RAD_Attr_Vendor_Specific 26
22 #define RAD_Attr_Calling_Station_Id 31
23 #define RAD_Attr_Tunnel_Password 69
24 #define RAD_Attr_Message_Authenticator 80
25
26 #define RAD_VS_ATTR_MS_MPPE_Send_Key 16
27 #define RAD_VS_ATTR_MS_MPPE_Recv_Key 17
28
29 struct radmsg {
30     uint8_t code;
31     uint8_t id;
32     uint8_t auth[20];
33     struct list *attrs;
34 };
35
36 void radmsg_free(struct radmsg *);
37 struct radmsg *radmsg_init(uint8_t, uint8_t, uint8_t *);
38 int radmsg_add(struct radmsg *, struct tlv *);
39 struct tlv *radmsg_gettype(struct radmsg *, uint8_t);
40 uint8_t *radmsg2buf(struct radmsg *msg, uint8_t *);
41 struct radmsg *buf2radmsg(uint8_t *, uint8_t *, uint8_t *);
42
43 /* Local Variables: */
44 /* c-file-style: "stroustrup" */
45 /* End: */