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
80ssize_t route_details(char *buf, size_t buflen, const entry_t *e);
81
82
83/* handler function pointer type */
84typedef int(*cmd_handler_t)(parser_t *parser, int no, char *args);
85
86/* command definition type */
87typedef struct {
88 const char *cmd;
89 cmd_handler_t cmd_handler;
90 const char *desc;
91 const char *syntax;
92} cmd_def_t;
93
94
95/* command definitions per context */
96extern const cmd_def_t cmds_root[];
97extern const cmd_def_t cmds_config[];
98extern const cmd_def_t cmds_routemap[];
99extern const cmd_def_t cmds_trip[];
100extern const cmd_def_t *ctx_cmds[];
101
102#endif /* _COMMANDS_H */
103
int cmd_disable(parser_t *parser, int no, char *args)
Disable configuration.
Definition commands.c:123
int cmd_config_log(parser_t *parser, int no, char *args)
Log file and level.
Definition commands.c:381
int cmd_shutdown(parser_t *parser, int no, char *args)
Terminate daemon.
Definition commands.c:364
int cmd_config_routemap_set(parser_t *parser, int no, char *args)
Set attribute.
Definition commands.c:846
int cmd_help(parser_t *parser, int no, char *args)
Contextual help.
Definition commands.c:106
int cmd_show(parser_t *parser, int no, char *args)
Show stuff.
Definition commands.c:192
int cmd_end(parser_t *parser, int no, char *args)
End configuration.
Definition commands.c:75
int cmd_exit(parser_t *parser, int no, char *args)
Exit current context.
Definition commands.c:90
int cmd_config_trip(parser_t *parser, int no, char *args)
TRIP routing context.
Definition commands.c:791
int cmd_config_bind(parser_t *parser, int no, char *args)
Bind address.
Definition commands.c:425
int cmd_config_trip_peer(parser_t *parser, int no, char *args)
Configure new peer.
Definition commands.c:985
int cmd_configure(parser_t *parser, int no, char *args)
Enter configuration.
Definition commands.c:130
int cmd_config_trip_timers(parser_t *parser, int no, char *args)
Set timers.
Definition commands.c:933
int cmd_config_routemap_match(parser_t *parser, int no, char *args)
Match attribute.
Definition commands.c:817
int cmd_config_routemap(parser_t *parser, int no, char *args)
Route map.
Definition commands.c:752
int cmd_enable(parser_t *parser, int no, char *args)
Enable configuration.
Definition commands.c:116
int cmd_config_trip_lsid(parser_t *parser, int no, char *args)
Set Location Server ID.
Definition commands.c:905
Command parser.
Definition commands.h:87
Route Entry.
Definition trib.h:78
Parser object.
Definition parser.h:50