The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
src
listen
control
conduit.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: 83244952e65bb7a5e416355aaf316792ea5b4bfb $
20
*
21
* @file conduit.h
22
* @brief API to provide distinct communication conduits for the radmin protocol.
23
*
24
* @copyright 2015 Alan DeKok (aland@deployingradius.com)
25
*/
26
RCSIDH
(conduit_h,
"$Id: 83244952e65bb7a5e416355aaf316792ea5b4bfb $"
)
27
28
#ifdef __cplusplus
29
extern
"C"
{
30
#endif
31
32
#define FR_CONDUIT_MAGIC (0xf7eead17)
33
34
typedef
enum
fr_conduit_type_t
{
35
FR_CONDUIT_STDIN
= 0,
36
FR_CONDUIT_STDOUT
,
37
FR_CONDUIT_STDERR
,
38
FR_CONDUIT_CMD_STATUS
,
39
FR_CONDUIT_INIT_ACK
,
40
FR_CONDUIT_AUTH_CHALLENGE
,
41
FR_CONDUIT_AUTH_RESPONSE
,
42
FR_CONDUIT_NOTIFY
,
43
FR_CONDUIT_HELP
,
44
FR_CONDUIT_COMPLETE
,
45
}
fr_conduit_type_t
;
46
47
typedef
enum
fr_conduit_origin_t
{
48
FR_ORIGIN_SIGNAL
= 0,
49
FR_ORIGIN_DEBUG
,
50
FR_ORIGIN_WORKER
,
51
}
fr_conduit_origin_t
;
52
53
typedef
enum
fr_conduit_result_t
{
54
FR_CONDUIT_FAIL
= 0,
55
FR_CONDUIT_PARTIAL
,
56
FR_CONDUIT_SUCCESS
57
}
fr_conduit_result_t
;
58
59
typedef
enum
fr_conduit_notify_t
{
60
FR_NOTIFY_NONE
= 0,
61
FR_NOTIFY_BUFFERED
,
62
FR_NOTIFY_UNBUFFERED
63
}
fr_conduit_notify_t
;
64
65
#define COMMAND_BUFFER_SIZE (1024)
66
67
typedef
struct
{
68
int
auth
;
69
int
mode
;
70
ssize_t
offset
;
71
ssize_t
next
;
72
char
buffer
[
COMMAND_BUFFER_SIZE
];
73
}
fr_cs_buffer_t
;
74
75
typedef
struct
{
76
uint16_t
origin
;
77
uint16_t
conduit
;
78
uint32_t
length
;
79
}
fr_conduit_hdr_t
;
80
81
82
ssize_t
fr_conduit_read_async
(
int
fd,
fr_conduit_type_t
*pconduit,
void
*inbuf,
size_t
buflen,
83
size_t
*leftover,
bool
*want_more);
84
ssize_t
fr_conduit_read
(
int
fd,
fr_conduit_type_t
*pconduit,
void
*
buffer
,
size_t
buflen);
85
ssize_t
fr_conduit_write
(
int
fd,
fr_conduit_type_t
conduit,
void
const
*
buffer
,
size_t
buflen);
86
87
#ifdef __cplusplus
88
}
89
#endif
buffer
static int const char char buffer[256]
Definition:
acutest.h:574
RCSIDH
#define RCSIDH(h, id)
Definition:
build.h:482
fr_cs_buffer_t::mode
int mode
Definition:
conduit.h:69
fr_conduit_hdr_t::conduit
uint16_t conduit
Definition:
conduit.h:77
fr_conduit_result_t
fr_conduit_result_t
Definition:
conduit.h:53
FR_CONDUIT_FAIL
@ FR_CONDUIT_FAIL
Definition:
conduit.h:54
FR_CONDUIT_PARTIAL
@ FR_CONDUIT_PARTIAL
Definition:
conduit.h:55
FR_CONDUIT_SUCCESS
@ FR_CONDUIT_SUCCESS
Definition:
conduit.h:56
fr_conduit_notify_t
fr_conduit_notify_t
Definition:
conduit.h:59
FR_NOTIFY_NONE
@ FR_NOTIFY_NONE
Definition:
conduit.h:60
FR_NOTIFY_BUFFERED
@ FR_NOTIFY_BUFFERED
Definition:
conduit.h:61
FR_NOTIFY_UNBUFFERED
@ FR_NOTIFY_UNBUFFERED
Definition:
conduit.h:62
fr_conduit_hdr_t::length
uint32_t length
Definition:
conduit.h:78
fr_conduit_type_t
fr_conduit_type_t
Definition:
conduit.h:34
FR_CONDUIT_STDOUT
@ FR_CONDUIT_STDOUT
Definition:
conduit.h:36
FR_CONDUIT_AUTH_RESPONSE
@ FR_CONDUIT_AUTH_RESPONSE
Definition:
conduit.h:41
FR_CONDUIT_HELP
@ FR_CONDUIT_HELP
Definition:
conduit.h:43
FR_CONDUIT_NOTIFY
@ FR_CONDUIT_NOTIFY
Definition:
conduit.h:42
FR_CONDUIT_STDIN
@ FR_CONDUIT_STDIN
Definition:
conduit.h:35
FR_CONDUIT_STDERR
@ FR_CONDUIT_STDERR
Definition:
conduit.h:37
FR_CONDUIT_CMD_STATUS
@ FR_CONDUIT_CMD_STATUS
Definition:
conduit.h:38
FR_CONDUIT_INIT_ACK
@ FR_CONDUIT_INIT_ACK
Definition:
conduit.h:39
FR_CONDUIT_COMPLETE
@ FR_CONDUIT_COMPLETE
Definition:
conduit.h:44
FR_CONDUIT_AUTH_CHALLENGE
@ FR_CONDUIT_AUTH_CHALLENGE
Definition:
conduit.h:40
fr_conduit_read_async
ssize_t fr_conduit_read_async(int fd, fr_conduit_type_t *pconduit, void *inbuf, size_t buflen, size_t *leftover, bool *want_more)
Definition:
conduit.c:75
fr_cs_buffer_t::auth
int auth
Definition:
conduit.h:68
fr_cs_buffer_t::offset
ssize_t offset
Definition:
conduit.h:70
fr_cs_buffer_t::next
ssize_t next
Definition:
conduit.h:71
fr_conduit_write
ssize_t fr_conduit_write(int fd, fr_conduit_type_t conduit, void const *buffer, size_t buflen)
Definition:
conduit.c:228
fr_conduit_read
ssize_t fr_conduit_read(int fd, fr_conduit_type_t *pconduit, void *buffer, size_t buflen)
Definition:
conduit.c:146
COMMAND_BUFFER_SIZE
#define COMMAND_BUFFER_SIZE
Definition:
conduit.h:65
fr_conduit_hdr_t::origin
uint16_t origin
Definition:
conduit.h:76
fr_conduit_origin_t
fr_conduit_origin_t
Definition:
conduit.h:47
FR_ORIGIN_WORKER
@ FR_ORIGIN_WORKER
Definition:
conduit.h:50
FR_ORIGIN_SIGNAL
@ FR_ORIGIN_SIGNAL
Definition:
conduit.h:48
FR_ORIGIN_DEBUG
@ FR_ORIGIN_DEBUG
Definition:
conduit.h:49
fr_conduit_hdr_t
Definition:
conduit.h:75
fr_cs_buffer_t
Definition:
conduit.h:67
uint16_t
unsigned short uint16_t
Definition:
merged_model.c:31
uint32_t
unsigned int uint32_t
Definition:
merged_model.c:33
ssize_t
long int ssize_t
Definition:
merged_model.c:24
Generated by
1.9.1