The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
radutmp.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: 3eafb379528d775bdfd437df4418d7096e92c63b $
20  *
21  * @file lib/server/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: 3eafb379528d775bdfd437df4418d7096e92c63b $")
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
#define RCSIDH(h, id)
Definition: build.h:482
unsigned int framed_address
Definition: radutmp.h:60
char porttype
Definition: radutmp.h:65
time_t time
Definition: radutmp.h:62
char reserved[12]
Definition: radutmp.h:68
char res1
Definition: radutmp.h:66
char login[32]
Definition: radutmp.h:54
int type
Definition: radutmp.h:64
unsigned int nas_address
Definition: radutmp.h:59
char session_id[8]
Definition: radutmp.h:57
time_t delay
Definition: radutmp.h:63
char caller_id[16]
Definition: radutmp.h:67
char res3
Definition: radutmp.h:66
unsigned int nas_port
Definition: radutmp.h:56
int proto
Definition: radutmp.h:61
char res2
Definition: radutmp.h:66