~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to server/netlist.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-07-20 19:48:50 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050720194850-oo61wjr33rrx2mre
Tags: upstream-2.0.2
ImportĀ upstreamĀ versionĀ 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "common.h"
21
21
 
22
 
#include "upstype.h"
23
22
#include "upsd.h"
24
23
#include "sstate.h"
25
24
#include "state.h"
26
25
#include "neterr.h"
27
26
 
 
27
#include "netlist.h"
 
28
 
28
29
        extern  upstype *firstups;      /* for list_ups */
29
30
 
30
31
static int tree_dump(struct st_tree_t *node, ctype *client, const char *ups, 
216
217
        sendback(client, "END LIST UPS\n");
217
218
}       
218
219
 
219
 
int net_list(ctype *client, int numarg, char **arg)
 
220
void net_list(ctype *client, int numarg, const char **arg)
220
221
{
221
222
        if (numarg < 1) {
222
223
                send_err(client, NUT_ERR_INVALID_ARGUMENT);
223
 
                return 1;
 
224
                return;
224
225
        }
225
226
 
226
227
        /* LIST UPS */
227
228
        if (!strcasecmp(arg[0], "UPS")) {
228
229
                list_ups(client);
229
 
                return 1;
 
230
                return;
230
231
        }
231
232
 
232
233
        if (numarg < 2) {
233
234
                send_err(client, NUT_ERR_INVALID_ARGUMENT);
234
 
                return 1;
 
235
                return;
235
236
        }
236
237
 
237
238
        /* LIST VAR UPS */
238
239
        if (!strcasecmp(arg[0], "VAR")) {
239
240
                list_var(client, arg[1]);
240
 
                return 1;
 
241
                return;
241
242
        }
242
243
 
243
244
        /* LIST RW UPS */
244
245
        if (!strcasecmp(arg[0], "RW")) {
245
246
                list_rw(client, arg[1]);
246
 
                return 1;
 
247
                return;
247
248
        }
248
249
 
249
250
        /* LIST CMD UPS */
250
251
        if (!strcasecmp(arg[0], "CMD")) {
251
252
                list_cmd(client, arg[1]);
252
 
                return 1;
 
253
                return;
253
254
        }
254
255
 
255
256
        if (numarg < 3) {
256
257
                send_err(client, NUT_ERR_INVALID_ARGUMENT);
257
 
                return 1;
 
258
                return;
258
259
        }
259
260
 
260
261
        /* LIST ENUM UPS VARNAME */
261
262
        if (!strcasecmp(arg[0], "ENUM")) {
262
263
                list_enum(client, arg[1], arg[2]);
263
 
                return 1;
 
264
                return;
264
265
        }
265
266
 
266
267
        send_err(client, NUT_ERR_INVALID_ARGUMENT);
267
 
        return 1;
268
268
}