TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
commands.c File Reference
#include "commands.h"
#include "cli.h"
#include <command/parser.h>
#include <db/pib.h>
#include <functions/manager.h>
#include <functions/session.h>
#include <protocol/protocol.h>
#include <logging/logging.h>
#include <util/util.h>
#include <db/trib.h>
#include <api/server.h>
#include <enum/enum.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.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)
ssize_t route_details (char *buf, size_t buflen, const entry_t *e)
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_api (parser_t *parser, int no, char *args)
int cmd_config_enum (parser_t *parser, int no, char *args)
int cmd_config_route (parser_t *parser, int no, char *args)
int cmd_config_acl (parser_t *parser, int no, char *args)
int cmd_config_routemap (parser_t *parser, int no, char *args)
 Route map.
int cmd_config_trip (parser_t *parser, int no, char *args)
 TRIP routing context.
int cmd_config_routemap_match (parser_t *parser, int no, char *args)
 Match attribute.
int cmd_config_routemap_set (parser_t *parser, int no, char *args)
 Set attribute.
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_default (parser_t *parser, int no, char *args)
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_routemap []
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 for trip", "bind-address <addr> [port]" },
{ "api", &cmd_config_api, "set bind address and port for http api", "api [addr] [port]" },
{ "enum", &cmd_config_enum, "set zone, bind address and port for enum query interface", "enum [zone] [addr] [port]" },
{ "route", &cmd_config_route, "insert route into routing table", "route { add <af> <prefix> <app-proto> <server> | del <af> <prefi> }" },
{ "acl", &cmd_config_acl, "add acl entry", "acl <acl-name> { permit | deny } <expression>" },
{ "route-map", &cmd_config_routemap, "define route map", "route-map <map-name> [ permit | deny ]" },
{ "trip", &cmd_config_trip, "trip configuration", "trip <itad>" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_log(parser_t *parser, int no, char *args)
Log file and level.
Definition commands.c:381
int cmd_help(parser_t *parser, int no, char *args)
Contextual help.
Definition commands.c:106
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_routemap(parser_t *parser, int no, char *args)
Route map.
Definition commands.c:752

◆ 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 | session [addr] | route [destination] | acl [name] | route-map [name] >" },
{ "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:123
int cmd_shutdown(parser_t *parser, int no, char *args)
Terminate daemon.
Definition commands.c:364
int cmd_show(parser_t *parser, int no, char *args)
Show stuff.
Definition commands.c:192
int cmd_configure(parser_t *parser, int no, char *args)
Enter configuration.
Definition commands.c:130
int cmd_enable(parser_t *parser, int no, char *args)
Enable configuration.
Definition commands.c:116

◆ cmds_routemap

const cmd_def_t cmds_routemap[]
Initial value:
= {
{ "end", &cmd_end, "exit from configure mode", NULL },
{ "exit", &cmd_exit,"exit current context", NULL },
{ "help", &cmd_help,"show command help", NULL },
{ "match", &cmd_config_routemap_match, "match routes", "match <af> <acl-name> [ <acl-name> ... ]" },
{ "set", &cmd_config_routemap_set, "modify routes", "set <attribute> <value> ... see documentation" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_routemap_set(parser_t *parser, int no, char *args)
Set attribute.
Definition commands.c:846
int cmd_config_routemap_match(parser_t *parser, int no, char *args)
Match attribute.
Definition commands.c:817

◆ 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]" },
{ "default", &cmd_config_trip_default, "set defaults", "default { local-preference | metric } <value>" },
{ "peer", &cmd_config_trip_peer, "add peer", "peer <host> { remote-itad <itad> | route-map <map-name> }" },
{ NULL, NULL, NULL, NULL }
}
int cmd_config_trip_peer(parser_t *parser, int no, char *args)
Configure new peer.
Definition commands.c:985
int cmd_config_trip_timers(parser_t *parser, int no, char *args)
Set timers.
Definition commands.c:933
int cmd_config_trip_lsid(parser_t *parser, int no, char *args)
Set Location Server ID.
Definition commands.c:905

◆ ctx_cmds

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