| /* OsmoBTS VTY interface */ |
| |
| #include <sys/socket.h> |
| #include <netinet/in.h> |
| #include <arpa/inet.h> |
| |
| #include <osmocom/core/talloc.h> |
| #include <osmocom/gsm/abis_nm.h> |
| #include <osmocom/vty/vty.h> |
| #include <osmocom/vty/command.h> |
| #include <osmocom/vty/logging.h> |
| |
| #include <osmocom/trau/osmo_ortp.h> |
| |
| |
| #include "pcu_vty.h" |
| |
| |
| enum node_type pcu_vty_go_parent(struct vty *vty) |
| { |
| switch (vty->node) { |
| #if 0 |
| case TRX_NODE: |
| vty->node = BTS_NODE; |
| { |
| struct gsm_bts_trx *trx = vty->index; |
| vty->index = trx->bts; |
| } |
| break; |
| #endif |
| default: |
| vty->node = CONFIG_NODE; |
| } |
| return vty->node; |
| } |
| |
| int pcu_vty_is_config_node(struct vty *vty, int node) |
| { |
| switch (node) { |
| #if 0 |
| case TRX_NODE: |
| case BTS_NODE: |
| return 1; |
| #endif |
| default: |
| return 0; |
| } |
| } |
| |
| gDEFUN(ournode_exit, ournode_exit_cmd, "exit", |
| "Exit current node, go down to provious node") |
| { |
| switch (vty->node) { |
| #if 0 |
| case TRXV_NODE: |
| vty->node = BTS_NODE; |
| { |
| struct gsm_bts_trx *trx = vty->index; |
| vty->index = trx->bts; |
| } |
| break; |
| #endif |
| default: |
| break; |
| } |
| return CMD_SUCCESS; |
| } |
| |
| gDEFUN(ournode_end, ournode_end_cmd, "end", |
| "End current mode and change to enable mode") |
| { |
| switch (vty->node) { |
| default: |
| vty_config_unlock(vty); |
| vty->node = ENABLE_NODE; |
| vty->index = NULL; |
| vty->index_sub = NULL; |
| break; |
| } |
| return CMD_SUCCESS; |
| } |
| |
| static const char pcu_copyright[] = |
| "Copyright (C) 2012 by ...\r\n" |
| "License GNU GPL version 2 or later\r\n" |
| "This is free software: you are free to change and redistribute it.\r\n" |
| "There is NO WARRANTY, to the extent permitted by law.\r\n"; |
| |
| struct vty_app_info pcu_vty_info = { |
| .name = "Osmo-PCU", |
| .version = PACKAGE_VERSION, |
| .copyright = pcu_copyright, |
| .go_parent_cb = pcu_vty_go_parent, |
| .is_config_node = pcu_vty_is_config_node, |
| }; |
| |
| int pcu_vty_init(const struct log_info *cat) |
| { |
| // install_element_ve(&show_pcu_cmd); |
| |
| logging_vty_add_cmds(cat); |
| |
| return 0; |
| } |