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_routemap(parser_t *parser, int no, char *args);
60int cmd_config_trip(parser_t *parser, int no, char *args);
61
62/* routemap context */
63
65int cmd_config_routemap_match(parser_t *parser, int no, char *args);
66
68int cmd_config_routemap_set(parser_t *parser, int no, char *args);
69
70/* trip context */
71
73int cmd_config_trip_lsid(parser_t *parser, int no, char *args);
75int cmd_config_trip_timers(parser_t *parser, int no, char *args);
77int cmd_config_trip_peer(parser_t *parser, int no, char *args);
78
79
80/* handler function pointer type */
81typedef int(*cmd_handler_t)(parser_t *parser, int no, char *args);
82
83/* command definition type */
84typedef struct {
85 const char *cmd;
86 cmd_handler_t cmd_handler;
87 const char *desc;
88 const char *syntax;
89} cmd_def_t;
90
91
92/* command definitions per context */
93extern const cmd_def_t cmds_root[];
94extern const cmd_def_t cmds_config[];
95extern const cmd_def_t cmds_routemap[];
96extern const cmd_def_t cmds_trip[];
97extern const cmd_def_t *ctx_cmds[];
98
99#endif /* _COMMANDS_H */
100
int cmd_disable(parser_t *parser, int no, char *args)
Disable configuration.
Definition commands.c:122
int cmd_config_log(parser_t *parser, int no, char *args)
Log file and level.
Definition commands.c:328
int cmd_shutdown(parser_t *parser, int no, char *args)
Terminate daemon.
Definition commands.c:312
int cmd_config_routemap_set(parser_t *parser, int no, char *args)
Set attribute.
Definition commands.c:684
int cmd_help(parser_t *parser, int no, char *args)
Contextual help.
Definition commands.c:105
int cmd_show(parser_t *parser, int no, char *args)
Show stuff.
Definition commands.c:149
int cmd_end(parser_t *parser, int no, char *args)
End configuration.
Definition commands.c:73
int cmd_exit(parser_t *parser, int no, char *args)
Exit current context.
Definition commands.c:88
int cmd_config_trip(parser_t *parser, int no, char *args)
TRIP routing context.
Definition commands.c:629
int cmd_config_bind(parser_t *parser, int no, char *args)
Bind address.
Definition commands.c:372
int cmd_config_trip_peer(parser_t *parser, int no, char *args)
Configure new peer.
Definition commands.c:823
int cmd_configure(parser_t *parser, int no, char *args)
Enter configuration.
Definition commands.c:129
int cmd_config_trip_timers(parser_t *parser, int no, char *args)
Set timers.
Definition commands.c:771
int cmd_config_routemap_match(parser_t *parser, int no, char *args)
Match attribute.
Definition commands.c:655
int cmd_config_routemap(parser_t *parser, int no, char *args)
Route map.
Definition commands.c:590
int cmd_enable(parser_t *parser, int no, char *args)
Enable configuration.
Definition commands.c:115
int cmd_config_trip_lsid(parser_t *parser, int no, char *args)
Set Location Server ID.
Definition commands.c:743
Command parser.
Definition commands.h:84
Parser object.
Definition parser.h:50