On Thu, Apr 10, 2014 at 03:40:38PM +0200, Alvaro Neira Ayuso wrote:
> From: Álvaro Neira Ayuso <[email protected]>
> 
> With this patch, the manager monitors the sensors and send
> OML Failure message from the Manager to the BTS and the BTS
> to BSC, for having a report system of the sensors.
> 
> Signed-off-by: Alvaro Neira Ayuso <[email protected]>
> ---
> [change in v7]
> * Added specific error report in all the errors case that we can find
> * Refactor some code using a new variable abis_om_hdr_len
> * Changed LOGL_NOTICE to LOGL_ERROR in all the LOGP that I have used for
>   reporting errors
> * Change the function send_to for using the states variables that I have 
> created
>   for showing the connection state between sysmobts-mgr and sysmobts
> * Fixed a leak in the function send_to
> 
>  src/osmo-bts-sysmo/main.c               |  168 
> +++++++++++++++++++++++++++++++
>  src/osmo-bts-sysmo/misc/sysmobts_mgr.c  |   82 +++++++++++++++
>  src/osmo-bts-sysmo/misc/sysmobts_mgr.h  |    5 +
>  src/osmo-bts-sysmo/misc/sysmobts_misc.c |  145 +++++++++++++++++++++++++-
>  src/osmo-bts-sysmo/misc/sysmobts_misc.h |   33 ++++++
>  5 files changed, 432 insertions(+), 1 deletion(-)
> 
> diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
> index 74ee47f..b93667d 100644
> --- a/src/osmo-bts-sysmo/main.c
> +++ b/src/osmo-bts-sysmo/main.c
> @@ -35,8 +35,10 @@
>  
>  #include <osmocom/core/talloc.h>
>  #include <osmocom/core/application.h>
> +#include <osmocom/core/socket.h>
>  #include <osmocom/vty/telnet_interface.h>
>  #include <osmocom/vty/logging.h>
> +#include <osmocom/gsm/protocol/ipaccess.h>
>  
>  #include <osmo-bts/gsm_data.h>
>  #include <osmo-bts/logging.h>
> @@ -45,13 +47,18 @@
>  #include <osmo-bts/vty.h>
>  #include <osmo-bts/bts_model.h>
>  #include <osmo-bts/pcu_if.h>
> +#include <osmo-bts/oml.h>
>  
>  #define SYSMOBTS_RF_LOCK_PATH        "/var/lock/bts_rf_lock"
> +#define SOCKET_PATH          "/var/run/bts_oml"
> +
> +#define IPA_OML_PROTO                0xFF
>  
>  #include "utils.h"
>  #include "eeprom.h"
>  #include "l1_if.h"
>  #include "hw_misc.h"
> +#include "btsconfig.h"
>  
>  /* FIXME: read from real hardware */
>  const uint8_t abis_mac[6] = { 0,1,2,3,4,5 };
> @@ -258,6 +265,7 @@ static void signal_handler(int signal)
>       case SIGINT:
>               //osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
>               bts_shutdown(bts, "SIGINT");
> +             unlink(SOCKET_PATH);
>               break;
>       case SIGABRT:
>       case SIGUSR1:
> @@ -288,6 +296,159 @@ static int write_pid_file(char *procname)
>       return 0;
>  }
>  
> +#ifdef BUILD_SBTS2050
> +static int test_recv_msg(struct msgb *msg)
> +{
> +     struct ipaccess_head *hh;
> +     struct abis_om_hdr *omh;
> +     int abis_oml_hdr_len;
> +
> +     if (msg->len < sizeof(struct ipaccess_head)) {
> +             LOGP(DL1C, LOGL_ERROR, "Failed: ipa header insufficient 
> space\n");
                                        ^^^^^^^

You have to remove the "Failed:", LOGL_ERROR already includes the tag.

Now this fits in one line per 80-chars:

        if (msg->len < sizeof(struct ipaccess_head)) {
                LOGP(DL1C, LOGL_ERROR, "ipa header insufficient space\n");

Reply via email to