blob: d89a1ae6b640d1acd501b1a6f0bc444446fb308e [file] [log] [blame]
Harald Weltec4338de2015-12-24 00:40:52 +01001#pragma once
2
3#include <stdint.h>
Neels Hofmeyredf13672016-04-23 13:50:46 +02004#include <stdbool.h>
Neels Hofmeyrf1f2d7c2016-01-05 12:00:06 +01005#include <osmocom/ranap/RANAP_Cause.h>
6#include <osmocom/ranap/RANAP_CN-DomainIndicator.h>
7#include <osmocom/ranap/RANAP_GlobalRNC-ID.h>
Neels Hofmeyra9f55662016-04-19 01:21:41 +02008#include <osmocom/ranap/RANAP_ChosenIntegrityProtectionAlgorithm.h>
9#include <osmocom/ranap/RANAP_ChosenEncryptionAlgorithm.h>
Neels Hofmeyr04b5b662019-01-16 17:00:15 +010010#include <osmocom/ranap/RANAP_KeyStatus.h>
Harald Weltef8db61b2015-12-18 17:29:59 +010011
12/*! \brief generate RANAP DIRECT TRANSFER message */
13struct msgb *ranap_new_msg_dt(uint8_t sapi, const uint8_t *nas, unsigned int nas_len);
14
15/*! \brief generate RANAP SECURITY MODE COMMAND message */
Harald Weltee3f707b2021-02-06 15:55:48 +010016struct msgb *ranap_new_msg_sec_mod_cmd2(const uint8_t *ik, const uint8_t *ck, enum RANAP_KeyStatus status,
17 uint8_t uia_bitmask, uint8_t uea_bitmask);
18
Daniel Willmannf44d12c2016-04-20 10:16:37 +020019struct msgb *ranap_new_msg_sec_mod_cmd(const uint8_t *ik, const uint8_t *ck, enum RANAP_KeyStatus status);
Harald Weltef8db61b2015-12-18 17:29:59 +010020
Neels Hofmeyra9f55662016-04-19 01:21:41 +020021/*! \brief generate RANAP SECURITY MODE COMPLETE message */
22struct msgb *ranap_new_msg_sec_mod_compl(
23 RANAP_ChosenIntegrityProtectionAlgorithm_t chosen_ip_alg,
24 RANAP_ChosenEncryptionAlgorithm_t chosen_enc_alg);
25
Harald Weltef8db61b2015-12-18 17:29:59 +010026/*! \brief generate RANAP COMMON ID message */
27struct msgb *ranap_new_msg_common_id(const char *imsi);
28
29/*! \brief generate RANAP IU RELEASE COMMAND message */
30struct msgb *ranap_new_msg_iu_rel_cmd(const RANAP_Cause_t *cause_in);
31
Neels Hofmeyrf6e16b72016-04-19 02:32:05 +020032/*! \brief generate RAPAP IU RELEASE COMPLETE message */
33struct msgb *ranap_new_msg_iu_rel_compl(void);
34
Harald Weltef8db61b2015-12-18 17:29:59 +010035/*! \brief generate RANAP PAGING COMMAND message */
36struct msgb *ranap_new_msg_paging_cmd(const char *imsi, const uint32_t *tmsi, int is_ps, uint32_t cause);
37
38/*! \brief generate RANAP RAB ASSIGNMENT REQUEST message for CS (voice) */
Neels Hofmeyrf6673b72016-09-08 15:39:18 +020039struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip,
40 uint16_t rtp_port,
41 bool use_x213_nsap);
Harald Weltef8db61b2015-12-18 17:29:59 +010042
43/*! \brief generate RANAP RAB ASSIGNMENT REQUEST message for PS (data) */
Neels Hofmeyredf13672016-04-23 13:50:46 +020044struct msgb *ranap_new_msg_rab_assign_data(uint8_t rab_id, uint32_t gtp_ip,
45 uint32_t gtp_tei, bool use_x213_nsap);
Harald Weltec4338de2015-12-24 00:40:52 +010046
47/*! \brief generate RANAP RESET message */
48struct msgb *ranap_new_msg_reset(RANAP_CN_DomainIndicator_t domain,
Harald Welte1cdb81d2016-01-01 16:21:05 +010049 const RANAP_Cause_t *cause);
Harald Weltec4338de2015-12-24 00:40:52 +010050
51/*! \brief generate RANAP RESET ACK message */
52struct msgb *ranap_new_msg_reset_ack(RANAP_CN_DomainIndicator_t domain,
53 RANAP_GlobalRNC_ID_t *rnc_id);
Harald Welteea98b6f2015-12-24 15:09:06 +010054
55
56/*! \brief generate RANAP INITIAL UE message */
57struct msgb *ranap_new_msg_initial_ue(uint32_t conn_id, int is_ps,
58 RANAP_GlobalRNC_ID_t *rnc_id,
59 uint8_t *nas_pdu, unsigned int nas_len);
Harald Welte37223d82016-01-01 16:18:55 +010060
61/*! \brief generate RANAP IU RELEASE REQUEST message */
62struct msgb *ranap_new_msg_iu_rel_req(const RANAP_Cause_t *cause);
63
64/*! \brief generate RANAP RAB RELEASE REQUEST message */
65struct msgb *ranap_new_msg_rab_rel_req(uint8_t rab_id, const RANAP_Cause_t *cause);