Commit Graph

71 Commits

Author SHA1 Message Date
Harald Welte c31f480f08 [VTY] use new struct vty_app_info in libvty 2010-05-25 23:40:38 +02:00
Harald Welte 4b037e4117 Migrate VTY code to libosmovty 2010-05-25 23:40:38 +02:00
Harald Welte 5bc61dc384 VTY: separate VTY logging commands and OpenBSC node exit code 2010-05-16 22:02:16 +02:00
Harald Welte dcccb1818d VTY: decouple telnet_interface from 'struct gsmnet'
We want the VTY and telnet code to be independent from the BSC
application(s).  As a side note, we also like to eliminate static
global variables for 'struct gsm_network' all over the code.

As such, telnet_init() is now passed along a "private" pointer,
which getst stored in telnet_connection.priv.  This telnet_connection
is then stored in vty->priv, which in turn gets dereferenced if
anyone needs a reference to 'struct gsm_network' from the BSC vty
code.

Also:
 * vty_init() now calls cmd_init()
 * the ugliness that telnet_init() calls back into the application by means of
   bsc_vty_init() function has been removed.
 * telnet_init() now returns any errors, so the main program can exit
   e.g. if the port is already in use.
2010-05-16 20:52:23 +02:00
Harald Welte 1353f961ef VTY: pass program name, version and copyright to vty_init()
This enables us to make the VTY completely independent of any
compile-time program-specific information, i.e. one step closer
to using VTY as a shared library from multiple programs.
2010-05-16 19:20:24 +02:00
Harald Welte 54f7424b78 [VTY] Introduce "end" command that works from any level in config
Using "end" you can always return to the "enable" level, and from
there the "show" commands are available.  So no more need for
exit/exit/exit/exit/disable.
2010-05-14 19:11:04 +02:00
Harald Welte 62ab20c5dd [VTY] Remove OpenBSC specific node-exit handling from src/vty
The idea is to move the VTY code into libosmocore at some point,
and for that we need to eliminate OpenBSC specifics from it
2010-05-14 18:59:17 +02:00
Holger Hans Peter Freyther b5be7ac39c [mgcp] Make show mgcp available in both modes. 2010-05-14 02:45:52 +08:00
Holger Hans Peter Freyther 7373109abc Merge branch 'master' into on-waves/mgcp 2010-05-14 02:42:15 +08:00
Holger Hans Peter Freyther c1cb5eb38d [mgcp] Clean up VTY code, the ranges are checked by the VTY code. 2010-05-14 02:39:51 +08:00
Holger Hans Peter Freyther 1384af6522 [mgcp] Use A.B.C.D for the ip addresses inside the vty config
Make the vty code parse the ip addresses for us and validate
them for us.
2010-05-14 02:39:42 +08:00
Holger Hans Peter Freyther b3c206aa34 [mgcp] Improve the language of the comments. 2010-05-14 02:39:33 +08:00
Holger Hans Peter Freyther b715d7f890 [mgcp] Include stdlib.h for abs. 2010-05-14 02:39:16 +08:00
Holger Hans Peter Freyther 8f12fe818b [mgcp] Remove talloc.h header. 2010-04-30 13:35:31 +08:00
Holger Hans Peter Freyther a581136f73 [misc] Remove spaces, fix indention. 2010-04-30 13:34:15 +08:00
Holger Hans Peter Freyther 32d4e50d46 [mgcp] Possible memleak fix for the allowed reallocation case
When allowing to reallocate an allocated endpoint we will need
to free it first. When freeing we will free the call id and other
ids that we would have leaked otherwise.
2010-04-25 23:02:55 +08:00
Holger Hans Peter Freyther dc41755fc7 [mgcp] Add a change callback and send a dummy packet on MDCX.
Send a dummy packet to make sure our Gateway will discover us
and can send the ringtone to us.
2010-04-25 23:02:43 +08:00
Holger Hans Peter Freyther aa9d3ce97a [mgcp] Ignore every dummy packet...
This routine should operate on different packets and the
dummy load is smaller than a legitimate RTP header so it
is unlikely we will filture out genuine traffic.

The reason is the dummy load might be send more than once.
2010-04-25 23:02:27 +08:00
Holger Hans Peter Freyther e3d16bb775 [mgcp] Protocol extension to not generate answers.
For the NAT we want to send requests in a send and forget
way and we are not interested in seeing the answers, so tell
the gateway to not answer them.
2010-04-25 23:02:17 +08:00
Holger Hans Peter Freyther 74076934fb [mgcp] Print a Deleted endpoint message again. 2010-04-25 23:02:05 +08:00
Holger Hans Peter Freyther b844b876ad [mgcp] Add a dummy send method...
This can be used by higher level code to send one dummy
message from the audio port to the network. This can be
used to make the remote discover the nated port of this
endpoint.
2010-04-25 23:01:55 +08:00
Holger Hans Peter Freyther 8d9833ef83 [mgcp] Fix vty file generation for the BSC nat and other cases
The current setting was not properly written out, this commit is
fixing it. This includes indention, empty bts ip, wrong command
for endpoints and the wrong number (+1 as zero is allocated but
unused).
2010-04-17 06:45:08 +02:00
Holger Hans Peter Freyther 2d425059af [mgcp] Only write audio_name/payload when it is actually set. 2010-04-15 11:26:35 +02:00
Holger Hans Peter Freyther 5615b982c2 [mgcp] Improve the endpoint display on the vty..
Make sure one understands the two values for number of
incoming packets..
2010-04-09 23:53:08 +02:00
Holger Hans Peter Freyther aff596b8e1 [mgcp] Print the IP addr of the BTS we have detected. 2010-04-09 23:53:00 +02:00
Holger Hans Peter Freyther 441273766a [mgcp] Add the logging commands for the MGCP command. 2010-04-07 22:55:17 +02:00
Holger Hans Peter Freyther 575b89585f [mgcp] Print the errno/strerror when we can not receive from our socket 2010-04-07 22:52:40 +02:00
Holger Hans Peter Freyther 408cc4ace9 [mgcp] Add an option to allow using reallocing an endpoint
For some mode of operation it can be acceptable to reallocate
an already allocated endpoint. This can be the case when we
only deal with one call agent that is keeping track of the
endpoint but slightly confused.
2010-04-07 22:52:25 +02:00
Holger Hans Peter Freyther b4b135efbf [mgcp] Count incoming RTP packets from the BTS and remote 2010-04-07 22:51:59 +02:00
Holger Hans Peter Freyther b4c7b274a1 [mgcp] Reset the the address when freeing the endp as well 2010-04-06 12:13:19 +02:00
Holger Hans Peter Freyther 7279d24232 [mgcp] Do not patch RTP payload when type is set to -1.
For the nat we might or might not want to patch it, do not
patch if we have no valid rtp payload type.
2010-04-06 12:12:52 +02:00
Holger Hans Peter Freyther 6c0729fe70 [mgcp] Print the BTS IP addr of the endpoint. 2010-04-05 22:04:15 +02:00
Holger Hans Peter Freyther 8b120f0ef9 [mgcp] Look at the bts addr set at the endpoint
This will allow to discover the ports of a bts when we only know
the addr and have multiple bts's to handle.
2010-04-05 22:03:04 +02:00
Holger Hans Peter Freyther f2f1591ce7 [mgcp] Export header parsing via mgcp internal
This will be used by the NAT code to implement custom protocol
handling on top of that.
2010-04-05 22:02:54 +02:00
Holger Hans Peter Freyther f36a11a35d [mgcp] Do not operate on the ->data pointer, use ->l2h instead
This would have been broken once we attempt to parse encapsulated
MGCP messages.
2010-04-05 22:02:47 +02:00
Holger Hans Peter Freyther c77efdf057 [mgcp] Degrade verbosity to debug 2010-04-05 22:02:38 +02:00
Holger Hans Peter Freyther b79994c952 [mgcp] Add a new config option to set the call agent ip addr
In the case of the nat we only want to communicate with one
upstream call agent and this can now be configured.
2010-04-05 22:02:29 +02:00
Holger Hans Peter Freyther 64e4e77558 [mgcp] Handle the RSIP with resetting all endpoints
We could change that the message came from a special ip
address/port to secure this service in general but we don't
do that right now.
2010-04-05 22:01:52 +02:00
Holger Hans Peter Freyther 9bdcc9ca75 [mgcp] Add some parsing for RSIP messages coming in
This will just call a callback and leave all the handling
to the application.
2010-04-05 22:01:44 +02:00
Holger Hans Peter Freyther e7d2ae69c9 [mgcp] Remove unused method from the mgcp
This was removed when sending the RSIP was
removed from the code.
2010-04-05 22:01:36 +02:00
Holger Hans Peter Freyther 52a66aa27e [mgcp] Switch from DEBUG to LOGP in the mgcp_main.c 2010-04-05 22:01:28 +02:00
Holger Hans Peter Freyther 13d67b7ea3 [mgcp] Remove the sending of RSIP
This message is ignored by the call agent and we were
sending this on the first request which we maybe should
not ignore...
2010-04-05 22:01:20 +02:00
Holger Hans Peter Freyther 95e4d34f06 [mgcp] The networking code needs a source addrs..
Make the source address mandantory and complain about
complain when it is missing. The address is mandantory
as it needs to be put into the MGCP messages...
2010-03-30 15:35:57 +02:00
Holger Hans Peter Freyther f5b6aa60ce [mgcp] Move mgcp init into the main method... 2010-03-30 15:35:48 +02:00
Holger Hans Peter Freyther c38b5884ff [mgcp] Fix format string usage 2010-03-30 15:35:39 +02:00
Holger Hans Peter Freyther 4079105a6c Merge remote branch 'origin/master' into on-waves/mgcp 2010-03-30 15:35:26 +02:00
Holger Hans Peter Freyther acf8a0c59f [misc] Remove whitespace from the end of the line. 2010-03-29 08:47:44 +02:00
Harald Welte dc5062b185 move log/debug codebase to libosmocore
The logging/debugging code is generic enough to move it into libosmocore
while keeping OpenBSC specific definitions in openbsc itself.

This commit uses the logging support present in libosmocore-0.1.2,
you will have to update your library to this version.
2010-03-26 21:31:43 +08:00
Harald Welte 5a29c7fa89 automatically include program version and print it from vty and --version 2010-03-23 00:09:32 +08:00
Holger Hans Peter Freyther 774f0723bf [mgcp] Do not print potentially many messages... 2010-03-01 18:53:05 +01:00