Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / radutmp.h
1 /*
2  * radutmp.h    Definitions for the Radius UTMP file.
3  *
4  * Version:     $Id$
5  */
6
7 #ifndef _RADUTMP_H
8 #define _RADUTMP_H
9
10 #include <freeradius-devel/ident.h>
11 RCSIDH(radutmp_h, "$Id$")
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 /*
18  *      Types of connection.
19  */
20 #ifndef P_UNKNOWN
21 #  define P_UNKNOWN       0
22 #  define P_LOCAL         'L'
23 #  define P_RLOGIN        'R'
24 #  define P_SLIP          'S'
25 #  define P_CSLIP         'C'
26 #  define P_PPP           'P'
27 #  define P_AUTOPPP       'A'
28 #  define P_TELNET        'E'
29 #  define P_TCPCLEAR      'T'
30 #  define P_TCPLOGIN      'U'
31 #  define P_CONSOLE       '!'
32 #  define P_SHELL         'X'
33 #endif
34
35 #define P_IDLE          0
36 #define P_LOGIN         1
37
38 struct radutmp {
39   char login[32];               /* Loginname */
40                                 /* FIXME: extend to 48 or 64 bytes */
41   unsigned int nas_port;        /* Port on the terminal server (32 bits). */
42   char session_id[8];           /* Radius session ID (first 8 bytes at least)*/
43                                 /* FIXME: extend to 16 or 32 bytes */
44   unsigned int nas_address;     /* IP of portmaster. */
45   unsigned int framed_address;  /* SLIP/PPP address or login-host. */
46   int proto;                    /* Protocol. */
47   time_t time;                  /* Time entry was last updated. */
48   time_t delay;                 /* Delay time of request */
49   int type;                     /* Type of entry (login/logout) */
50   char porttype;                /* Porttype (I=ISDN A=Async T=Async-ISDN */
51   char res1,res2,res3;          /* Fills up to one int */
52   char caller_id[16];           /* Calling-Station-ID */
53   char reserved[12];            /* 3 ints reserved */
54 };
55
56 /*
57  *      Take the size of the structure from the actual structure definition.
58  */
59 #define RUT_NAMESIZE sizeof(((struct radutmp *) NULL)->login)
60 #define RUT_SESSSIZE sizeof(((struct radutmp *) NULL)->session_id)
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif /* _RADUTMP_H */