TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
commands.c File Reference
#include "commands.h"
#include "cli.h"
#include "functions/manager.h"
#include "functions/session.h"
#include "protocol/protocol.h"
#include <ctype.h>
#include <logging/logging.h>
#include <netinet/in.h>
#include <util/util.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <time.h>
Include dependency graph for commands.c:

Functions

int cmd_end (parser_t *parser, int no, char *args)
 End configuration.
int cmd_exit (parser_t *parser, int no, char *args)
 Exit current context.
int cmd_help (parser_t *parser, int no, char *args)
 Contextual help.
int cmd_enable (parser_t *parser, int no, char *args)
 Enable configuration.
int cmd_disable (parser_t *parser, int no, char *args)
 Disable configuration.
int cmd_configure (parser_t *parser, int no, char *args)
 Enter configuration.
void time_since (char *buff, time_t since)
int cmd_show (parser_t *parser, int no, char *args)
 Show stuff.
int cmd_shutdown (parser_t *parser, int no, char *args)
 Terminate daemon.
int cmd_config_log (parser_t *parser, int no, char *args)
 Log file and level.
int cmd_config_bind (parser_t *parser, int no, char *args)
 Bind address.
int cmd_config_prefixlist (parser_t *parser, int no, char *args)
 Prefix list.
int cmd_config_trip (parser_t *parser, int no, char *args)
 TRIP routing context.
int cmd_config_prefixlist_prefix (parser_t *parser, int no, char *args)
 New prefix.
int cmd_config_trip_lsid (parser_t *parser, int no, char *args)
 Set Location Server ID.
int cmd_config_trip_timers (parser_t *parser, int no, char *args)
 Set timers.
int cmd_config_trip_peer (parser_t *parser, int no, char *args)
 Configure new peer.

Variables

const cmd_def_t cmds_root []
const cmd_def_t cmds_config []
const cmd_def_t cmds_prefixlist []
const cmd_def_t cmds_trip []
const cmd_def_tctx_cmds []

Variable Documentation

◆ cmds_config

const cmd_def_t cmds_config[]
Initial value:
= {
{ "end", &cmd_end, "exit from configure mode", NULL },
{ "exit", &cmd_exit,"exit current context", NULL },
{ "help", &cmd_help,"show command help", NULL },
{ "log", &cmd_config_log, "set log file", "log <log file>" },
{ "bind-address", &cmd_config_bind, "set bind address and port", "bind-address <addr> <port>" },
{ "prefix-list", &cmd_config_prefixlist, "define prefix list", "prefix-list <name>" },
{ "trip", &cmd_config_trip, "trip configuration", "trip <itad>" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_prefixlist(parser_t *parser, int no, char *args)
Prefix list.
Definition commands.c:288
int cmd_config_log(parser_t *parser, int no, char *args)
Log file and level.
Definition commands.c:203
int cmd_help(parser_t *parser, int no, char *args)
Contextual help.
Definition commands.c:71
int cmd_end(parser_t *parser, int no, char *args)
End configuration.
Definition commands.c:49
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

◆ cmds_prefixlist

const cmd_def_t cmds_prefixlist[]
Initial value:
= {
{ "end", &cmd_end, "exit from configure mode", NULL },
{ "exit", &cmd_exit,"exit current context", NULL },
{ "help", &cmd_help,"show command help", NULL },
{ "prefix", &cmd_config_prefixlist_prefix, "add prefix", "prefix <pfx-type> <prefix> <app-layer-proto> <server>" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_prefixlist_prefix(parser_t *parser, int no, char *args)
New prefix.
Definition commands.c:321

◆ cmds_root

const cmd_def_t cmds_root[]
Initial value:
= {
{ "end", &cmd_end, "exit from configure mode", NULL },
{ "exit", &cmd_exit,"exit current context", NULL },
{ "help", &cmd_help,"show command help", NULL },
{ "enable", &cmd_enable, "enable privileged commands", NULL },
{ "disable", &cmd_disable, "disable privileged commands", NULL },
{ "configure", &cmd_configure, "enter configuration mode", NULL },
{ "show", &cmd_show, "show running system information", "show < running-config | peers | sessions | session <host> >" },
{ "shutdown", &cmd_shutdown, "shutdown system", NULL },
{ NULL, NULL, NULL, NULL }
}
int cmd_disable(parser_t *parser, int no, char *args)
Disable configuration.
Definition commands.c:88
int cmd_shutdown(parser_t *parser, int no, char *args)
Terminate daemon.
Definition commands.c:187
int cmd_show(parser_t *parser, int no, char *args)
Show stuff.
Definition commands.c:115
int cmd_configure(parser_t *parser, int no, char *args)
Enter configuration.
Definition commands.c:95
int cmd_enable(parser_t *parser, int no, char *args)
Enable configuration.
Definition commands.c:81

◆ cmds_trip

const cmd_def_t cmds_trip[]
Initial value:
= {
{ "end", &cmd_end, "exit from configure mode", NULL },
{ "exit", &cmd_exit,"exit current context", NULL },
{ "help", &cmd_help,"show command help", NULL },
{ "ls-id", &cmd_config_trip_lsid, "set local id", "ls-id <id in dotted notation" },
{ "timers", &cmd_config_trip_timers, "set timers", "timers <hold> [keep-alive] [connect-retry] [max-purge-time] [disable-time] [min-itad-orig-int] [min-route-advert-int]" },
{ "peer", &cmd_config_trip_peer, "add peer", "peer <host> remote-itad <itad>" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_trip_peer(parser_t *parser, int no, char *args)
Configure new peer.
Definition commands.c:389
int cmd_config_trip_timers(parser_t *parser, int no, char *args)
Set timers.
Definition commands.c:357
int cmd_config_trip_lsid(parser_t *parser, int no, char *args)
Set Location Server ID.
Definition commands.c:329

◆ ctx_cmds

const cmd_def_t* ctx_cmds[]
Initial value:
= {
cmds_root,
cmds_config,
cmds_prefixlist,
cmds_trip
}