Commit c14ef5ed authored by Yann Garcia's avatar Yann Garcia
Browse files

Update Geolocation header support

parent 976f5ffd
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -465,7 +465,7 @@ void sip_codec_message_body::decode_message_body(const osip_message_t* p_sip_mes
          if ((*header->hname == 'v') && (*(header->hname + 1) == '=') && (*(header->hname + 2) == '0')) { // SDP
          if ((*header->hname == 'v') && (*(header->hname + 1) == '=') && (*(header->hname + 2) == '0')) { // SDP
            loggers::get_instance().log("sip_codec_message_body::decode_message_body: Decode SDP");
            loggers::get_instance().log("sip_codec_message_body::decode_message_body: Decode SDP");
            LibSip__MessageBodyTypes::MIME__Encapsulated__Part p;
            LibSip__MessageBodyTypes::MIME__Encapsulated__Part p;
            p.content__type() = CHARSTRING("sdp");
            p.content__type() = CHARSTRING("application/sdp");
            p.content__disposition().set_to_omit();
            p.content__disposition().set_to_omit();
            p.content__id().set_to_omit();
            p.content__id().set_to_omit();
            LibSip__SDPTypes::SDP__Message sdp_body;
            LibSip__SDPTypes::SDP__Message sdp_body;
@@ -483,7 +483,7 @@ void sip_codec_message_body::decode_message_body(const osip_message_t* p_sip_mes
          } else if ((*header->hname == '<') && (*(header->hname + 1) == '?') && (*(header->hname + 2) == 'x')) { // <?xml
          } else if ((*header->hname == '<') && (*(header->hname + 1) == '?') && (*(header->hname + 2) == 'x')) { // <?xml
              loggers::get_instance().log("sip_codec_message_body::decode_message_body: Decode XML");
              loggers::get_instance().log("sip_codec_message_body::decode_message_body: Decode XML");
              LibSip__MessageBodyTypes::MIME__Encapsulated__Part p;
              LibSip__MessageBodyTypes::MIME__Encapsulated__Part p;
              p.content__type() = CHARSTRING("xml");
              p.content__type() = CHARSTRING("application/resource-lists+xml");
              p.content__disposition().set_to_omit();
              p.content__disposition().set_to_omit();
              p.content__id().set_to_omit();
              p.content__id().set_to_omit();
              LibSip__XMLTypes::XmlBody xml_body;
              LibSip__XMLTypes::XmlBody xml_body;
+12 −1
Original line number Original line Diff line number Diff line
@@ -8,6 +8,9 @@


#include "udp_layer_factory.hh"
#include "udp_layer_factory.hh"


#include <sys/ioctl.h>
#include <net/if.h>

udp_layer::udp_layer(const std::string & p_type, const std::string & param) : layer(p_type), PORT(p_type.c_str()), _params(), _saddr{0}, _daddr{0}, _fd(-1), _time_key("udp_layer::Handle_Fd_Event_Readable") {
udp_layer::udp_layer(const std::string & p_type, const std::string & param) : layer(p_type), PORT(p_type.c_str()), _params(), _saddr{0}, _daddr{0}, _fd(-1), _time_key("udp_layer::Handle_Fd_Event_Readable") {
  loggers::get_instance().log(">>> udp_layer::udp_layer: %s, %s", to_string().c_str(), param.c_str());
  loggers::get_instance().log(">>> udp_layer::udp_layer: %s, %s", to_string().c_str(), param.c_str());
  
  
@@ -45,11 +48,19 @@ udp_layer::udp_layer(const std::string & p_type, const std::string & param) : la
    loggers::get_instance().warning("udp_layer::udp_layer: Failed to set SO_REUSEADDR");
    loggers::get_instance().warning("udp_layer::udp_layer: Failed to set SO_REUSEADDR");
  }
  }
  // Bind it
  // Bind it
  loggers::get_instance().log("udp_layer::udp_layer: Binding on port %s", _params["src_port"].c_str());
  /*struct ifreq ifr;
  memset(&ifr, 0, sizeof(ifr));
  snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "eth1");
  if (setsockopt(_fd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) {
    close();
    loggers::get_instance().error("udp_layer::udp_layer: Failed to bind socket to %s", ifr.ifr_name);
  }
  loggers::get_instance().log("udp_layer::udp_layer: Bound to device %s", ifr.ifr_name);*/
  if(::bind(_fd, (struct sockaddr *)&_saddr, sizeof(_saddr)) < 0) {
  if(::bind(_fd, (struct sockaddr *)&_saddr, sizeof(_saddr)) < 0) {
    close();
    close();
    loggers::get_instance().error("udp_layer::udp_layer: Failed to bind socket");
    loggers::get_instance().error("udp_layer::udp_layer: Failed to bind socket");
  }
  }
  loggers::get_instance().log("udp_layer::udp_layer: Bound on port %s", _params["src_port"].c_str());
  // Pass the device file handler to the polling procedure
  // Pass the device file handler to the polling procedure
  Handler_Add_Fd_Read(_fd);
  Handler_Add_Fd_Read(_fd);
  
  
+9 −4
Original line number Original line Diff line number Diff line
@@ -2,10 +2,10 @@
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.


# IUT roles
# IUT roles
LibNg112_Pics.PICS_LIS_IUT := true;
LibNg112_Pics.PICS_LIS_IUT  := false;
LibNg112_Pics.PICS_ECRF_IUT := false;
LibNg112_Pics.PICS_ECRF_IUT := false;
LibNg112_Pics.PICS_ESRP_IUT := false;
LibNg112_Pics.PICS_ESRP_IUT := false;
LibNg112_Pics.PICS_PSAP_IUT := false;
LibNg112_Pics.PICS_PSAP_IUT := true;


LibCommon_Time.PX_TAC := 30.0
LibCommon_Time.PX_TAC := 30.0
LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0;
LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0;
@@ -28,6 +28,8 @@ LibNg112_Pixits.PX_IMS_SUT_UE1_BEARER_IPADDR := "10.101.242.1" # Local UE addres
#LibNg112_Pics.PICS_S_SIP_UDP1 := false
#LibNg112_Pics.PICS_S_SIP_UDP1 := false
#LibSip_PIXITS.PX_SIP_TRANSPORT := "TCP"     # Transport is TCP
#LibSip_PIXITS.PX_SIP_TRANSPORT := "TCP"     # Transport is TCP
#LibNg112_Pixits.PX_IMS_TS_UE1_PORT := 5052  # SIP over TCP port
#LibNg112_Pixits.PX_IMS_TS_UE1_PORT := 5052  # SIP over TCP port
LibNg112_Pixits.PX_IMS_SUT_UE1_PUBLIC_USER := "8007"
LibNg112_Pixits.PX_IMS_SUT_UE1_HOME_DOMAIN := "huawei.com"


[LOGGING]
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# In this section you can specify the name of the log file and the classes of events
@@ -78,7 +80,7 @@ CallTaker.SIPP.params := "SIP/UDP(dst_ip=172.24.1.241,dst_port=5060,src_port=506


[EXECUTE]
[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
# In this section you can specify what parts of your test suite you want to execute.
#AtsNg112_TestControl.control
AtsNg112_TestControl.control


#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_02
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_02
@@ -87,7 +89,7 @@ CallTaker.SIPP.params := "SIP/UDP(dst_ip=172.24.1.241,dst_port=5060,src_port=506
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_07
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_07
AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_02
@@ -104,6 +106,9 @@ AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_13
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_13
#AtsNg112_TestCases.TC_ESRP_SIP_INVITE_BV_01
#AtsNg112_TestCases.TC_ESRP_SIP_INVITE_BV_01
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_01
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_01
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_02
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_03
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_04


[GROUPS]
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# In this section you can specify groups of hosts. These groups can be used inside the
+17 −26
Original line number Original line Diff line number Diff line
@@ -803,7 +803,7 @@ module AtsNg112_TestCases {
                                                                                                                                              mw_locationUriSet
                                                                                                                                              mw_locationUriSet
                                                                                                                                              )
                                                                                                                                              )
                                                                                                                          ))))) -> value v_response {
                                                                                                                          ))))) -> value v_response {
            var template charstring v_uri_pattern := "(http[s]#(0,1))://([^:/\\s]+)/(?+)";
            var template charstring v_uri_pattern := "(http[s]#(0,1))://([^/\\s]+)/(?+)";
            var charstring v_uri;
            var charstring v_uri;
            var charstring v_scheme;
            var charstring v_scheme;
            var charstring v_host;
            var charstring v_host;
@@ -1384,8 +1384,7 @@ module AtsNg112_TestCases {
                                                                                                                                          },
                                                                                                                                          },
                                                                                                                                        { },
                                                                                                                                        { },
                                                                                                                                        PX_V_FIRE_SERVICE_URN,
                                                                                                                                        PX_V_FIRE_SERVICE_URN,
                                                                                                                                        true,
                                                                                                                                        true
                                                                                                                                        value_
                                                                                                                                        )))
                                                                                                                                        )))
                                                         )));
                                                         )));
        f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
        f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
@@ -1792,16 +1791,8 @@ module AtsNg112_TestCases {
                                                         PICS_ECRF_URI,
                                                         PICS_ECRF_URI,
                                                         v_headers,
                                                         v_headers,
                                                         m_http_message_body_xml(
                                                         m_http_message_body_xml(
                                                                                 m_body_xml_list_services_by_location_request(
                                                                                 m_body_xml_list_services_request(
                                                                                                                              m_list_services_by_location(
                                                                                                                  m_list_services
                                                                                                                                                          {
                                                                                                                                                            m_location(
                                                                                                                                                                       PX_LOCATION_ID,
                                                                                                                                                                       { m_extension_point(encvalue_unichar(valueof(m_point(PX_POINT_IN_E_POLICE_SERVICE_BOUNDARY, PX_SRS_NAME, "point1")))) },
                                                                                                                                                                       "geodetic-2d" // TODO Use a Pixit
                                                                                                                                                                       )
                                                                                                                                                            }
                                                                                                                                                          )
                                                                                                                  )
                                                                                                                  )
                                                                                 )
                                                                                 )
                                                         )));
                                                         )));
@@ -1939,8 +1930,8 @@ module AtsNg112_TestCases {
        
        
        // Test Body
        // Test Body
        v_ecrf.start(f_TC_ESRP_SIP_INVITE_BV_01_ecrf());
        v_ecrf.start(f_TC_ESRP_SIP_INVITE_BV_01_ecrf());
        f_incCSeq(p_cSeq_s); v_ue.start(f_TC_ESRP_SIP_INVITE_BV_01_ue(p_cSeq_s));
        /*f_incCSeq(p_cSeq_s);*/ v_ue.start(f_TC_ESRP_SIP_INVITE_BV_01_ue(p_cSeq_s));
        f_incCSeq(p_cSeq_s); v_psap.start(f_TC_ESRP_SIP_INVITE_BV_01_psap(p_cSeq_s));
        /*f_incCSeq(p_cSeq_s);*/ v_psap.start(f_TC_ESRP_SIP_INVITE_BV_01_psap(p_cSeq_s));
        f_serverSyncNClientsAndStop(3, {c_prDone, c_tbDone, c_poDone});
        f_serverSyncNClientsAndStop(3, {c_prDone, c_tbDone, c_poDone});
        
        
        // Postamble
        // Postamble
@@ -2329,11 +2320,11 @@ module AtsNg112_TestCases {
        var ImsComponent v_call_taker;
        var ImsComponent v_call_taker;
        
        
        // Test control
        // Test control
        if (not(PICS_PSAP_IUT) or (not PICS_S_SIP_TCP1) or (not PICS_E_SIP_URN1) or not(PICS_B_SDP_ULA1)) {
        /*if (not(PICS_PSAP_IUT) or (not PICS_S_SIP_TCP1) or (not PICS_E_SIP_URN1) or not(PICS_B_SDP_ULA1)) {
          log("*** " & testcasename() & ": PICS_PSAP_IUT and PICS_S_SIP_TCP1 and PICS_E_SIP_URN1 and PICS_B_SDP_ULA1 required for executing the TC ***");
          log("*** " & testcasename() & ": PICS_PSAP_IUT and PICS_S_SIP_TCP1 and PICS_E_SIP_URN1 and PICS_B_SDP_ULA1 required for executing the TC ***");
          setverdict(inconc);
          setverdict(inconc);
          stop;
          stop;
        }
          }*/
        
        
        // Test component configuration
        // Test component configuration
        f_cf_02_up(v_caller, v_call_taker);
        f_cf_02_up(v_caller, v_call_taker);
+4 −0
Original line number Original line Diff line number Diff line
@@ -62,12 +62,16 @@ module AtsNg112_TestControl {
      }
      }
    }
    }
    if (PICS_PSAP_IUT) {
    if (PICS_PSAP_IUT) {
      //execute(TC_PSAP_SIP_INVITE_BV_04(v_cSeq));
      if (PICS_S_SIP_UDP1 and PICS_E_SIP_URN3) {
      if (PICS_S_SIP_UDP1 and PICS_E_SIP_URN3) {
        if (PICS_B_SDP_ULA1) { execute(TC_PSAP_SIP_INVITE_BV_01(v_cSeq)); }
        if (PICS_B_SDP_ULA1) { execute(TC_PSAP_SIP_INVITE_BV_01(v_cSeq)); }
      }
      }
      if (PICS_S_SIP_TCP1 and PICS_E_SIP_URN3) {
      if (PICS_S_SIP_TCP1 and PICS_E_SIP_URN3) {
        if (PICS_B_SDP_ULA1) { execute(TC_PSAP_SIP_INVITE_BV_03(v_cSeq)); }
        if (PICS_B_SDP_ULA1) { execute(TC_PSAP_SIP_INVITE_BV_03(v_cSeq)); }
      }
      }
      if (PICS_S_SIP_TCP1 and PICS_E_SIP_URN1) {
        if (PICS_B_SDP_ULA1) { execute(TC_PSAP_SIP_INVITE_BV_04(v_cSeq)); }
      }
    }
    }
  } // End of 'control' statement
  } // End of 'control' statement