Starting to add interface apply_traffic_flow_template between NAS and GW.

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent 2fcf8c1827
commit a7e0a0624b

@ -97,7 +97,8 @@ public:
class gw_interface_nas class gw_interface_nas
{ {
public: public:
virtual int setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t *ipv6_if_id, char *err_str) = 0; virtual int setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t* ipv6_if_id, char* err_str) = 0;
virtual int apply_traffic_flow_template(const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) = 0;
}; };
// GW interface for RRC // GW interface for RRC
@ -186,18 +187,18 @@ public:
const static int MAX_FOUND_PLMNS = 16; const static int MAX_FOUND_PLMNS = 16;
virtual void write_sdu(srslte::unique_byte_buffer_t sdu) = 0; virtual void write_sdu(srslte::unique_byte_buffer_t sdu) = 0;
virtual uint16_t get_mcc() = 0; virtual uint16_t get_mcc() = 0;
virtual uint16_t get_mnc() = 0; virtual uint16_t get_mnc() = 0;
virtual void enable_capabilities() = 0; virtual void enable_capabilities() = 0;
virtual int plmn_search(found_plmn_t found_plmns[MAX_FOUND_PLMNS]) = 0; virtual int plmn_search(found_plmn_t found_plmns[MAX_FOUND_PLMNS]) = 0;
virtual void plmn_select(asn1::rrc::plmn_id_s plmn_id) = 0; virtual void plmn_select(asn1::rrc::plmn_id_s plmn_id) = 0;
virtual bool connection_request(asn1::rrc::establishment_cause_e cause, virtual bool connection_request(asn1::rrc::establishment_cause_e cause,
srslte::unique_byte_buffer_t dedicatedInfoNAS) = 0; srslte::unique_byte_buffer_t dedicatedInfoNAS) = 0;
virtual void set_ue_idenity(asn1::rrc::s_tmsi_s s_tmsi) = 0; virtual void set_ue_idenity(asn1::rrc::s_tmsi_s s_tmsi) = 0;
virtual bool is_connected() = 0; virtual bool is_connected() = 0;
virtual std::string get_rb_name(uint32_t lcid) = 0; virtual std::string get_rb_name(uint32_t lcid) = 0;
virtual uint32_t get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id) = 0; virtual uint32_t get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id) = 0;
}; };
// RRC interface for PDCP // RRC interface for PDCP

@ -58,7 +58,8 @@ public:
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
// NAS interface // NAS interface
int setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t* ipv6_if_addr, char *err_str); int setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t* ipv6_if_addr, char* err_str);
int apply_traffic_flow_template(const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft);
// RRC interface // RRC interface
void add_mch_port(uint32_t lcid, uint32_t port); void add_mch_port(uint32_t lcid, uint32_t port);

@ -220,7 +220,11 @@ int gw::setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t
} }
int gw::apply_traffic_flow_template(const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft)
{
int err;
return SRSLTE_SUCCESS;
}
/******************************************************************************* /*******************************************************************************
RRC interface RRC interface
*******************************************************************************/ *******************************************************************************/

@ -1133,14 +1133,17 @@ void nas::parse_activate_dedicated_eps_bearer_context_request(uint32_t lcid, uni
{ {
LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT request; LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT request;
liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &request); liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &request);
nas_log->info( nas_log->info(
"Received Activate Dedicated EPS bearer context request (eps_bearer_id=%d, linked_bearer_id=%d, proc_id=%d)\n", "Received Activate Dedicated EPS bearer context request (eps_bearer_id=%d, linked_bearer_id=%d, proc_id=%d)\n",
request.eps_bearer_id, request.eps_bearer_id,
request.linked_eps_bearer_id, request.linked_eps_bearer_id,
request.proc_transaction_id); request.proc_transaction_id);
ctxt.rx_count++; LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft = &request.tft;
nas_log->info("Traffic Flow Template: TFT OP code 0x%x, Filter list size %d, Parameter list size %d\n",
tft->tft_op_code,
tft->packet_filter_list_size,
tft->parameter_list_size);
// check the a linked default bearer exists // check the a linked default bearer exists
if (eps_bearer.find(request.linked_eps_bearer_id) == eps_bearer.end()) { if (eps_bearer.find(request.linked_eps_bearer_id) == eps_bearer.end()) {
@ -1158,6 +1161,9 @@ void nas::parse_activate_dedicated_eps_bearer_context_request(uint32_t lcid, uni
return; return;
} }
// apply packet filters to GW
gw->apply_traffic_flow_template(tft);
send_activate_dedicated_eps_bearer_context_accept(request.proc_transaction_id, request.eps_bearer_id); send_activate_dedicated_eps_bearer_context_accept(request.proc_transaction_id, request.eps_bearer_id);
} }

@ -143,8 +143,9 @@ class gw_dummy : public gw_interface_nas, public gw_interface_pdcp
{ {
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
} }
void write_pdu(uint32_t lcid, unique_byte_buffer_t pdu) {} int apply_traffic_flow_template(const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) { return SRSLTE_SUCCESS; }
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {} void write_pdu(uint32_t lcid, unique_byte_buffer_t pdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
}; };
} }

Loading…
Cancel
Save