blob: 99c0f4f29889d318a52c8d0f03a3c71f2086d56a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/*
TACACS+ D-Bus Daemon code
Copyright (c) 2018-2019 AT&T Intellectual Property.
SPDX-License-Identifier: GPL-2.0-only
*/
#ifndef _TRANSACTION_H
#define _TRANSACTION_H
struct authen_send_param {
char *user;
char *password;
char *tty;
char *r_addr;
};
struct author_send_param {
char *login;
char *tty;
char *r_addr;
char *protocol;
char *service;
char *secrets;
char **cmd;
};
struct account_send_param {
int account_flag;
char *name;
char *tty;
char *r_addr;
char *task_id;
char *start_time;
char *stop_time;
char *service;
char *protocol;
char **command;
};
struct account_send_response {
int status;
};
struct authen_send_response {
int status;
};
struct author_send_response {
int status;
struct transaction_attrib *attrs;
};
typedef enum {
TRANSACTION_AUTHEN = 1,
TRANSACTION_AUTHOR,
TRANSACTION_ACCOUNT,
TRANSACTION_INVALID,
} transaction_type_t;
const char *transaction_type_str(transaction_type_t);
struct transaction {
transaction_type_t type;
union {
struct authen_send_param authen;
struct author_send_param author;
struct account_send_param account;
} request;
union {
struct authen_send_response authen;
struct author_send_response author;
struct account_send_response account;
} response;
void *user;
};
struct transaction *transaction_new(transaction_type_t);
void transaction_free(struct transaction **);
struct transaction_attrib {
struct transaction_attrib *next;
const char *name;
const char *value;
};
struct transaction_attrib *transaction_attrib_new(const char *);
void transaction_attrib_free(struct transaction_attrib **);
int tacplus_author_send(struct transaction *);
int tacplus_acct_send(struct transaction *);
int tacplus_authen_send(struct transaction *);
#endif /*_TRANSACTION_H */
|