Newer
Older
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/*
* dmoperate.c: Operate handler for uspd
*
* Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
*
* Author: Vivek Dutta <vivek.dutta@iopsys.eu>
* Author: Yashvardhan <y.yashvardhan@iopsys.eu>
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef __DMOPERATE_H__
#define __DMOPERATE_H__
#include <sys/param.h>
#define SYSTEM_UBUS_PATH "system"
#define NETWORK_INTERFACE_UBUS_PATH "network.interface"
#define NETWORK_WIRELESS_UBUS_PATH "network.wireless"
#define ROUTER_WIRELESS_UBUS_PATH "router.wireless"
#define ICWMP_SCRIPT "/usr/sbin/icwmp"
#define VCF_FILE_TYPE "3"
enum operate_ret_status{
UBUS_INVALID_ARGUMENTS,
SUCCESS,
FAIL,
CMD_NOT_FOUND,
__STATUS_MAX,
};
typedef enum operate_ret_status opr_ret_t;
typedef opr_ret_t (*operation) (struct dmctx *dmctx, char *p, char *input);
struct wifi_security_params {
char node[MAXNAMLEN];
char *param;
char value[MAXNAMLEN];
};
struct file_server {
char *url;
char *user;
char *pass;
};
struct neighboring_wiFi_diagnostic {
char *radio;
char *ssid;
char *bssid;
char *channel;
char *frequency;
char *encryption_mode;
char *operating_frequency_band;
char *supported_standards;
char *operating_standards;
char *operating_channel_bandwidth;
char *signal_strength;
char *noise;
};
struct ipping_diagnostics {
char *host;
char *interface;
char *proto;
char *nbofrepetition;
char *timeout;
char *datablocksize;
char *dscp;
char *success_count;
char *failure_count;
char *average_response_time;
char *minimum_response_time;
char *maximum_response_time;
char *average_response_time_detailed;
char *minimum_response_time_detailed;
char *maximum_response_time_detailed;
};
struct traceroute_diagnostics {
char *host;
char *interface;
char *proto;
char *nboftries;
char *timeout;
char *datablocksize;
char *dscp;
char *maxhops;
char *response_time;
char *host_name;
char *host_address;
char *rttimes;
};
struct download_diagnostics {
char *interface;
char *download_url;
char *dscp;
char *ethernet_priority;
char *proto;
char *num_of_connections;
char *enable_per_connection_results;
char *romtime;
char *bomtime;
char *eomtime;
char *test_bytes_received;
char *total_bytes_received;
char *total_bytes_sent;
char *test_bytes_received_under_full_loading;
char *total_bytes_received_under_full_loading;
char *total_bytes_sent_under_full_loading;
char *period_of_full_loading;
char *tcp_open_request_time;
char *tcp_open_response_time;
char *per_conn_romtime;
char *per_conn_bomtime;
char *per_conn_eomtime;
char *per_conn_test_bytes_received;
char *per_conn_total_bytes_received;
char *per_conn_total_bytes_sent;
char *per_conn_period_of_full_loading;
char *per_conn_tcp_open_request_time;
char *per_conn_tcp_open_response_time;
};
struct upload_diagnostics {
char *interface;
char *upload_url;
char *dscp;
char *ethernet_priority;
char *test_file_length;
char *proto;
char *num_of_connections;
char *enable_per_connection_results;
char *romtime;
char *bomtime;
char *eomtime;
char *test_bytes_sent;
char *total_bytes_received;
char *total_bytes_sent;
char *test_bytes_sent_under_full_loading;
char *total_bytes_received_under_full_loading;
char *total_bytes_sent_under_full_loading;
char *period_of_full_loading;
char *tcp_open_request_time;
char *tcp_open_response_time;
char *per_conn_romtime;
char *per_conn_bomtime;
char *per_conn_eomtime;
char *per_conn_test_bytes_sent;
char *per_conn_total_bytes_received;
char *per_conn_total_bytes_sent;
char *per_conn_period_of_full_loading;
char *per_conn_tcp_open_request_time;
char *per_conn_tcp_open_response_time;
};
struct udpecho_diagnostics {
char *host;
char *interface;
char *port;
char *nbofrepetition;
char *timeout;
char *datablocksize;
char *dscp;
char *inter_transmission_time;
char *response_time;
char *proto;
char *success_count;
char *failure_count;
char *average_response_time;
char *minimum_response_time;
char *maximum_response_time;
};
struct serverselection_diagnostics {
char *interface;
char *protocol_version;
char *proto;
char *hostlist;
char *port;
char *nbofrepetition;
char *timeout;
char *fasthost;
char *average_response_time;
char *minimum_response_time;
char *maximum_response_time;
};
struct nslookup_diagnostics {
char *interface;
char *hostname;
char *dnsserver;
char *timeout;
char *nbofrepetition;
char *success_count;
char *status;
char *answer_type;
char *hostname_returned;
char *ip_addresses;
char *dns_server_ip;
char *response_time;
};
struct op_cmd {
char *name;
operation opt;
};
int operate_on_node(struct dmctx *dmctx, char *path, char *input);
#endif