Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
src
include
channel.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_CHANNEL_H
17
#define _FR_CHANNEL_H
18
/**
19
* $Id: eb27af9f1cbae8145cbec6c3c044881e8dbb4c05 $
20
*
21
* @file include/channel.h
22
* @brief API to provide distinct communication channels for the radmin protocol.
23
*
24
* @copyright 2015 Alan DeKok <aland@deployingradius.com>
25
*/
26
RCSIDH
(channel_h,
"$Id: eb27af9f1cbae8145cbec6c3c044881e8dbb4c05 $"
)
27
28
#ifdef __cplusplus
29
extern
"C"
{
30
#endif
31
32
typedef
enum
fr_channel_type_t
{
33
FR_CHANNEL_STDIN
= 0,
34
FR_CHANNEL_STDOUT
,
35
FR_CHANNEL_STDERR
,
36
FR_CHANNEL_CMD_STATUS
,
37
FR_CHANNEL_INIT_ACK
,
38
FR_CHANNEL_AUTH_CHALLENGE
,
39
FR_CHANNEL_AUTH_RESPONSE
,
40
FR_CHANNEL_WANT_MORE
,
41
FR_CHANNEL_NOTIFY
42
}
fr_channel_type_t
;
43
44
typedef
enum
fr_channel_result_t
{
45
FR_CHANNEL_FAIL
= 0,
46
FR_CHANNEL_SUCCESS
47
}
fr_channel_result_t
;
48
49
typedef
enum
fr_channel_notify_t
{
50
FR_NOTIFY_NONE
= 0,
51
FR_NOTIFY_BUFFERED
,
52
FR_NOTIFY_UNBUFFERED
53
}
fr_channel_notify_t
;
54
55
56
ssize_t
fr_channel_drain
(
int
fd,
fr_channel_type_t
*pchannel,
void
*inbuf,
size_t
buflen, uint8_t **outbuf,
size_t
have_read);
57
ssize_t
fr_channel_read
(
int
fd,
fr_channel_type_t
*pchannel,
void
*buffer,
size_t
buflen);
58
ssize_t
fr_channel_write
(
int
fd,
fr_channel_type_t
channel,
void
const
*buffer,
size_t
buflen);
59
60
#ifdef __cplusplus
61
}
62
#endif
63
#endif
/* _FR_CHANNEL_H */
RCSIDH
#define RCSIDH(h, id)
Definition:
build.h:136
FR_CHANNEL_INIT_ACK
Definition:
channel.h:37
fr_channel_notify_t
fr_channel_notify_t
Definition:
channel.h:49
FR_CHANNEL_CMD_STATUS
Definition:
channel.h:36
FR_CHANNEL_AUTH_RESPONSE
Definition:
channel.h:39
FR_CHANNEL_AUTH_CHALLENGE
Definition:
channel.h:38
FR_CHANNEL_STDOUT
Definition:
channel.h:34
fr_channel_read
ssize_t fr_channel_read(int fd, fr_channel_type_t *pchannel, void *buffer, size_t buflen)
Definition:
channel.c:125
FR_CHANNEL_WANT_MORE
Definition:
channel.h:40
FR_CHANNEL_NOTIFY
Definition:
channel.h:41
fr_channel_type_t
fr_channel_type_t
Definition:
channel.h:32
FR_CHANNEL_FAIL
Definition:
channel.h:45
FR_CHANNEL_STDERR
Definition:
channel.h:35
FR_CHANNEL_SUCCESS
Definition:
channel.h:46
FR_CHANNEL_STDIN
Definition:
channel.h:33
FR_NOTIFY_NONE
Definition:
channel.h:50
fr_channel_write
ssize_t fr_channel_write(int fd, fr_channel_type_t channel, void const *buffer, size_t buflen)
Definition:
channel.c:205
fr_channel_drain
ssize_t fr_channel_drain(int fd, fr_channel_type_t *pchannel, void *inbuf, size_t buflen, uint8_t **outbuf, size_t have_read)
Definition:
channel.c:61
FR_NOTIFY_UNBUFFERED
Definition:
channel.h:52
FR_NOTIFY_BUFFERED
Definition:
channel.h:51
fr_channel_result_t
fr_channel_result_t
Definition:
channel.h:44
Generated on Sun Aug 28 2016 14:19:44 by
1.8.6