TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
commands.h
Go to the documentation of this file.
1/*
2
3 trip: Modern TRIP LS implementation
4 Copyright (C) 2025 arf20 (Ángel Ruiz Fernandez)
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef _COMMANDS_H
22#define _COMMANDS_H
23
24#include "parser.h"
25
29
30/* common context */
31
33int cmd_end(parser_t *parser, int no, char *args);
35int cmd_exit(parser_t *parser, int no, char *args);
37int cmd_help(parser_t *parser, int no, char *args);
38
39/* root context */
40
42int cmd_enable(parser_t *parser, int no, char *args);
44int cmd_disable(parser_t *parser, int no, char *args);
46int cmd_configure(parser_t *parser, int no, char *args);
48int cmd_show(parser_t *parser, int no, char *args);
50int cmd_shutdown(parser_t *parser, int no, char *args);
51
52/* config context */
54int cmd_config_log(parser_t *parser, int no, char *args);
56int cmd_config_bind(parser_t *parser, int no, char *args);
58int cmd_config_prefixlist(parser_t *parser, int no, char *args);
60int cmd_config_trip(parser_t *parser, int no, char *args);
61
62/* prefixlist context */
63
65int cmd_config_prefixlist_prefix(parser_t *parser, int no, char *args);
66
67/* trip context */
68
70int cmd_config_trip_lsid(parser_t *parser, int no, char *args);
72int cmd_config_trip_timers(parser_t *parser, int no, char *args);
74int cmd_config_trip_peer(parser_t *parser, int no, char *args);
75
76
77/* handler function pointer type */
78typedef int(*cmd_handler_t)(parser_t *parser, int no, char *args);
79
80/* command definition type */
81typedef struct {
82 const char *cmd;
83 cmd_handler_t cmd_handler;
84 const char *desc;
85 const char *syntax;
86} cmd_def_t;
87
88
89/* command definitions per context */
90extern const cmd_def_t cmds_root[];
91extern const cmd_def_t cmds_config[];
92extern const cmd_def_t cmds_prefixlist[];
93extern const cmd_def_t cmds_trip[];
94extern const cmd_def_t *ctx_cmds[];
95
96#endif /* _COMMANDS_H */
97
int cmd_config_prefixlist(parser_t *parser, int no, char *args)
Prefix list.
Definition commands.c:288
int cmd_disable(parser_t *parser, int no, char *args)
Disable configuration.
Definition commands.c:88
int cmd_config_log(parser_t *parser, int no, char *args)
Log file and level.
Definition commands.c:203
int cmd_shutdown(parser_t *parser, int no, char *args)
Terminate daemon.
Definition commands.c:187
int cmd_help(parser_t *parser, int no, char *args)
Contextual help.
Definition commands.c:71
int cmd_show(parser_t *parser, int no, char *args)
Show stuff.
Definition commands.c:115
int cmd_end(parser_t *parser, int no, char *args)
End configuration.
Definition commands.c:49
int cmd_config_prefixlist_prefix(parser_t *parser, int no, char *args)
New prefix.
Definition commands.c:321
int cmd_exit(parser_t *parser, int no, char *args)
Exit current context.
Definition commands.c:58
int cmd_config_trip(parser_t *parser, int no, char *args)
TRIP routing context.
Definition commands.c:296
int cmd_config_bind(parser_t *parser, int no, char *args)
Bind address.
Definition commands.c:247
int cmd_config_trip_peer(parser_t *parser, int no, char *args)
Configure new peer.
Definition commands.c:389
int cmd_configure(parser_t *parser, int no, char *args)
Enter configuration.
Definition commands.c:95
int cmd_config_trip_timers(parser_t *parser, int no, char *args)
Set timers.
Definition commands.c:357
int cmd_enable(parser_t *parser, int no, char *args)
Enable configuration.
Definition commands.c:81
int cmd_config_trip_lsid(parser_t *parser, int no, char *args)
Set Location Server ID.
Definition commands.c:329
Command parser.
Definition commands.h:81
Parser object.
Definition parser.h:49