All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
radutmp.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_RADUTMP_H
17 #define _FR_RADUTMP_H
18 /**
19  * $Id: 3cce15525cd51f30f90d5e3592c5a393bc248224 $
20  *
21  * @file include/radutmp.h
22  * @brief Definitions for session tracking with a 'UTMP' file
23  *
24  * @copyright 2015 The FreeRADIUS server project
25  */
26 RCSIDH(radutmp_h, "$Id: 3cce15525cd51f30f90d5e3592c5a393bc248224 $")
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /*
33  * Types of connection.
34  */
35 #ifndef P_UNKNOWN
36 # define P_UNKNOWN 0
37 # define P_LOCAL 'L'
38 # define P_RLOGIN 'R'
39 # define P_SLIP 'S'
40 # define P_CSLIP 'C'
41 # define P_PPP 'P'
42 # define P_AUTOPPP 'A'
43 # define P_TELNET 'E'
44 # define P_TCPCLEAR 'T'
45 # define P_TCPLOGIN 'U'
46 # define P_CONSOLE '!'
47 # define P_SHELL 'X'
48 #endif
49 
50 #define P_IDLE 0
51 #define P_LOGIN 1
52 
53 struct radutmp {
54  char login[32]; /* Loginname */
55  /* FIXME: extend to 48 or 64 bytes */
56  unsigned int nas_port; /* Port on the terminal server (32 bits). */
57  char session_id[8]; /* Radius session ID (first 8 bytes at least)*/
58  /* FIXME: extend to 16 or 32 bytes */
59  unsigned int nas_address; /* IP of portmaster. */
60  unsigned int framed_address; /* SLIP/PPP address or login-host. */
61  int proto; /* Protocol. */
62  time_t time; /* Time entry was last updated. */
63  time_t delay; /* Delay time of request */
64  int type; /* Type of entry (login/logout) */
65  char porttype; /* Porttype (I=ISDN A=Async T=Async-ISDN */
66  char res1,res2,res3; /* Fills up to one int */
67  char caller_id[16]; /* Calling-Station-ID */
68  char reserved[12]; /* 3 ints reserved */
69 };
70 
71 /*
72  * Take the size of the structure from the actual structure definition.
73  */
74 #define RUT_NAMESIZE sizeof(((struct radutmp *) NULL)->login)
75 #define RUT_SESSSIZE sizeof(((struct radutmp *) NULL)->session_id)
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* _RADUTMP_H */
int type
Definition: radutmp.h:64
char login[32]
Definition: radutmp.h:54
#define RCSIDH(h, id)
Definition: build.h:136
time_t delay
Definition: radutmp.h:63
unsigned int nas_address
Definition: radutmp.h:59
char session_id[8]
Definition: radutmp.h:57
unsigned int nas_port
Definition: radutmp.h:56
char porttype
Definition: radutmp.h:65
char reserved[12]
Definition: radutmp.h:68
char res2
Definition: radutmp.h:66
char res3
Definition: radutmp.h:66
unsigned int framed_address
Definition: radutmp.h:60
char caller_id[16]
Definition: radutmp.h:67
time_t time
Definition: radutmp.h:62
int proto
Definition: radutmp.h:61
char res1
Definition: radutmp.h:66