lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2025

  • 1 participants
  • 1491 discussions
[L] Change in osmo-pcap[master]: WIP: Support generation and storing of pcapng format
by pespin 08 Jan '25

08 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39265?usp=email ) Change subject: WIP: Support generation and storing of pcapng format ...................................................................... WIP: Support generation and storing of pcapng format TODO: * client: timestamp in EPB * server: detect pcap vs pcapng using magic field in link_hdr ** server: Do size checks based on pcap/pcapng knowledge ** server: Change saved file suffix based on pcap/pcapng knowledge. Change-Id: I3c80518a1e53a1f77e1aca8dfa83f683f9516ad6 --- M include/osmo-pcap/osmo_pcap_client.h M include/osmo-pcap/osmo_pcap_server.h M src/Makefile.am M src/osmo_client_core.c M src/osmo_client_network.c A src/osmo_client_pcap.c M src/osmo_client_vty.c M src/osmo_server_network.c 8 files changed, 704 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/65/39265/1 diff --git a/include/osmo-pcap/osmo_pcap_client.h b/include/osmo-pcap/osmo_pcap_client.h index 250a41f..83621bc 100644 --- a/include/osmo-pcap/osmo_pcap_client.h +++ b/include/osmo-pcap/osmo_pcap_client.h @@ -61,6 +61,12 @@ PROTOCOL_IPIP, }; +enum osmo_pcap_fmt { + OSMO_PCAP_FMT_PCAP = 0, + OSMO_PCAP_FMT_PCAPNG, +}; + + struct osmo_pcap_client_conn { struct llist_head entry; const char *name; @@ -114,6 +120,7 @@ int filter_itself; int gprs_filtering; int snaplen; + enum osmo_pcap_fmt pcap_fmt; struct osmo_pcap_client_conn *conn; struct llist_head conns; @@ -138,7 +145,9 @@ struct osmo_pcap_client_conn *osmo_client_conn_alloc(struct osmo_pcap_client *client, const char *name); void osmo_client_conn_free(struct osmo_pcap_client_conn *conn); void osmo_client_conn_send_data(struct osmo_pcap_client_conn *conn, - struct pcap_pkthdr *hdr, const uint8_t *data); + const struct osmo_pcap_handle *ph, + const struct pcap_pkthdr *pkthdr, + const uint8_t *data); void osmo_client_conn_send_link(struct osmo_pcap_client_conn *conn); void osmo_client_conn_connect(struct osmo_pcap_client_conn *conn); void osmo_client_conn_disconnect(struct osmo_pcap_client_conn *conn); @@ -149,6 +158,47 @@ void osmo_pcap_handle_free(struct osmo_pcap_handle *ph); int osmo_pcap_handle_start_capture(struct osmo_pcap_handle *ph); +unsigned int osmo_pcap_file_global_header_size(void); +int osmo_pcap_file_msgb_append_global_header(struct msgb *msg, uint32_t snaplen, uint32_t linktype); +unsigned int osmo_pcap_file_record_size(const struct pcap_pkthdr *in_hdr); +int osmo_pcap_file_msgb_append_record(struct msgb *msg, const struct pcap_pkthdr *in_hdr, const uint8_t *data); + +struct osmo_pcapng_file_shb_pars { + const char *hardware; + const char *os; + const char *userappl; +}; +unsigned int osmo_pcapng_file_shb_size(const struct osmo_pcapng_file_shb_pars *pars); +int osmo_pcapng_file_msgb_append_shb(struct msgb *msg, const struct osmo_pcapng_file_shb_pars *pars); + +struct osmo_pcapng_file_idb_pars { + //char *comment; + const char *name; + //char *descr; + //char *filter; + //char *os; + //char *hardware; + int link_type; + int snap_len; + //uint64_t *bytes_written; + //uint64_t if_speed; + //uint8_t tsresol; +}; +unsigned int osmo_pcapng_file_idb_size(const struct osmo_pcapng_file_idb_pars *pars); +int osmo_pcapng_file_msgb_append_idb(struct msgb *msg, const struct osmo_pcapng_file_idb_pars *pars); + +struct osmo_pcapng_file_epb_pars { + uint32_t interface_id; + uint32_t timestamp_high; + uint32_t timestamp_low; + const uint8_t *captured_data; + uint32_t captured_len; + uint32_t packet_len; +}; +unsigned int osmo_pcapng_file_epb_size(const struct osmo_pcapng_file_epb_pars *pars); +int osmo_pcapng_file_msgb_append_epb(struct msgb *msg, const struct osmo_pcapng_file_epb_pars *pars); + + #define LOGCONN(conn, lvl, fmt, args...) \ LOGP(DCLIENT, lvl, "CONN(%s,%s:%d) " fmt, (conn)->name, (conn)->srv_ip, (conn)->srv_port, ## args) diff --git a/include/osmo-pcap/osmo_pcap_server.h b/include/osmo-pcap/osmo_pcap_server.h index 614ceca..b3188a8 100644 --- a/include/osmo-pcap/osmo_pcap_server.h +++ b/include/osmo-pcap/osmo_pcap_server.h @@ -30,6 +30,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/write_queue.h> +#include <stdint.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -91,7 +92,8 @@ char *curr_filename; /* pcap stuff */ - struct pcap_file_header file_hdr; + uint8_t *file_hdr; + uint32_t file_hdr_len; /* last time */ struct tm last_write; diff --git a/src/Makefile.am b/src/Makefile.am index b35227c..47f7795 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,9 +17,10 @@ osmo_client_main.c \ osmo_common.c \ osmo_client_core.c \ - osmo_client_vty.c \ + osmo_client_pcap.c \ osmo_client_network.c \ osmo_client_stats.c \ + osmo_client_vty.c \ osmo_tls.c \ $(NULL) diff --git a/src/osmo_client_core.c b/src/osmo_client_core.c index a2ab894..dd16878 100644 --- a/src/osmo_client_core.c +++ b/src/osmo_client_core.c @@ -172,7 +172,7 @@ return 0; llist_for_each_entry(conn, &client->conns, entry) - osmo_client_conn_send_data(conn, &hdr, data); + osmo_client_conn_send_data(conn, ph, &hdr, data); return 0; } @@ -303,6 +303,7 @@ return NULL; client->snaplen = DEFAULT_SNAPLEN; + client->pcap_fmt = OSMO_PCAP_FMT_PCAP; INIT_LLIST_HEAD(&client->handles); INIT_LLIST_HEAD(&client->conns); diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 70fe740..a9282e4 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -1,6 +1,7 @@ /* * osmo-pcap-client code * + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> * (C) 2011-2016 by Holger Hans Peter Freyther <holger(a)moiji-mobile.com> * (C) 2011 by On-Waves * All Rights Reserved @@ -24,6 +25,7 @@ #include <osmo-pcap/common.h> #include <osmo-pcap/wireformat.h> +#include <osmocom/core/utils.h> #include <osmocom/core/msgb.h> #include <osmocom/core/rate_ctr.h> #include <osmocom/core/select.h> @@ -160,112 +162,287 @@ } } -void osmo_client_conn_send_data(struct osmo_pcap_client_conn *conn, - struct pcap_pkthdr *in_hdr, const uint8_t *data) +static struct msgb *osmo_client_conn_prepare_msg_data_pcap(struct osmo_pcap_client_conn *conn, + const struct osmo_pcap_handle *ph, + const struct pcap_pkthdr *pkthdr, + const uint8_t *data) { struct osmo_pcap_data *om_hdr; - struct osmo_pcap_pkthdr *hdr; struct msgb *msg; - int offset, ip_len; - struct osmo_pcap_handle *ph; + unsigned int record_size = osmo_pcap_file_record_size(pkthdr); - if (in_hdr->len > in_hdr->caplen) { - LOGCONN(conn, LOGL_ERROR, "Recording truncated packet, len %zu > snaplen %zu\n", - (size_t) in_hdr->len, (size_t) in_hdr->caplen); - rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_2BIG); - } - - msg = msgb_alloc(in_hdr->caplen + sizeof(*om_hdr) + sizeof(*hdr), "data-data"); + msg = msgb_alloc(sizeof(*om_hdr) + record_size, "pcap-data"); if (!msg) { LOGCONN(conn, LOGL_ERROR, "Failed to allocate\n"); rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_NOMEM); - return; + return NULL; + } + + om_hdr = (struct osmo_pcap_data *) msgb_put(msg, sizeof(*om_hdr)); + om_hdr->type = PKT_LINK_DATA; + om_hdr->len = htons(record_size); + osmo_pcap_file_msgb_append_record(msg, pkthdr, data); + + return msg; +} + +static struct msgb *osmo_client_conn_prepare_msg_data_pcapng(struct osmo_pcap_client_conn *conn, + const struct osmo_pcap_handle *ph, + const struct pcap_pkthdr *pkthdr, + const uint8_t *data) +{ + struct osmo_pcap_data *om_hdr; + struct msgb *msg; + struct osmo_pcapng_file_epb_pars epb_pars; + unsigned int record_size; + int rc; + + epb_pars = (struct osmo_pcapng_file_epb_pars){ + .interface_id = ph->idx, + .timestamp_high = 0, /* TODO: fill this properly */ + .timestamp_low = 0, /* TODO: fill this properly */ + .captured_data = data, + .captured_len = pkthdr->caplen, + .packet_len = pkthdr->len, + }; + + record_size = osmo_pcapng_file_epb_size(&epb_pars); + + msg = msgb_alloc(sizeof(*om_hdr) + record_size, "pcap-data"); + if (!msg) { + LOGCONN(conn, LOGL_ERROR, "Failed to allocate\n"); + rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_NOMEM); + return NULL; + } + + om_hdr = (struct osmo_pcap_data *) msgb_put(msg, sizeof(*om_hdr)); + om_hdr->type = PKT_LINK_DATA; + om_hdr->len = htons(record_size); + rc = osmo_pcapng_file_msgb_append_epb(msg, &epb_pars); + if (rc < 0) { + msgb_free(msg); + return NULL; + } + + return msg; +} + +static struct msgb *osmo_client_conn_prepare_msg_ipip(struct osmo_pcap_client_conn *conn, + const struct osmo_pcap_handle *ph, + const struct pcap_pkthdr *pkthdr, + const uint8_t *data) +{ + struct msgb *msg; + int offset, ip_len; + + offset = get_iphdr_offset(pcap_datalink(ph->handle)); + if (offset < 0) + return NULL; + + ip_len = pkthdr->caplen - offset; + if (ip_len < 0) + return NULL; + + + msg = msgb_alloc(ip_len, "ipip_msg"); + if (!msg) { + LOGP(DCLIENT, LOGL_ERROR, "Failed to allocate data.\n"); + rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_NOMEM); + return NULL; + } + msg->l2h = msgb_put(msg, ip_len); + memcpy(msg->l2h, data+offset, ip_len); + return msg; +} + +void osmo_client_conn_send_data(struct osmo_pcap_client_conn *conn, + const struct osmo_pcap_handle *ph, + const struct pcap_pkthdr *pkthdr, + const uint8_t *data) +{ + struct osmo_pcap_client *client = conn->client; + struct msgb *msg; + + if (pkthdr->len > pkthdr->caplen) { + LOGCONN(conn, LOGL_ERROR, "Recording truncated packet, len %zu > snaplen %zu\n", + (size_t) pkthdr->len, (size_t) pkthdr->caplen); + rate_ctr_inc2(client->ctrg, CLIENT_CTR_2BIG); } switch (conn->protocol) { case PROTOCOL_OSMOPCAP: - om_hdr = (struct osmo_pcap_data *) msgb_put(msg, sizeof(*om_hdr)); - om_hdr->type = PKT_LINK_DATA; + switch (client->pcap_fmt) { + case OSMO_PCAP_FMT_PCAP: + msg = osmo_client_conn_prepare_msg_data_pcap(conn, ph, pkthdr, data); + break; + case OSMO_PCAP_FMT_PCAPNG: + msg = osmo_client_conn_prepare_msg_data_pcapng(conn, ph, pkthdr, data); + break; + default: + OSMO_ASSERT(0); + } - msg->l2h = msgb_put(msg, sizeof(*hdr)); - hdr = (struct osmo_pcap_pkthdr *) msg->l2h; - hdr->ts_sec = in_hdr->ts.tv_sec; - hdr->ts_usec = in_hdr->ts.tv_usec; - hdr->caplen = in_hdr->caplen; - hdr->len = in_hdr->len; - - msg->l3h = msgb_put(msg, in_hdr->caplen); - memcpy(msg->l3h, data, in_hdr->caplen); - - om_hdr->len = htons(msgb_l2len(msg)); - rate_ctr_add2(conn->client->ctrg, CLIENT_CTR_BYTES, hdr->caplen); - rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_PKTS); break; case PROTOCOL_IPIP: - /* TODO: support capturing from multiple interfaces here: */ - ph = llist_first_entry_or_null(&conn->client->handles, struct osmo_pcap_handle, entry); - if (!ph) { - msgb_free(msg); - return; - } - offset = get_iphdr_offset(pcap_datalink(ph->handle)); - if (offset < 0) { - msgb_free(msg); - return; - } - ip_len = in_hdr->caplen - offset; - if (ip_len < 0) { - msgb_free(msg); - return; - } - msg->l2h = msgb_put(msg, ip_len); - memcpy(msg->l2h, data+offset, ip_len); + msg = osmo_client_conn_prepare_msg_ipip(conn, ph, pkthdr, data); break; default: OSMO_ASSERT(0); } + if (!msg) + return; + + rate_ctr_add2(conn->client->ctrg, CLIENT_CTR_BYTES, pkthdr->caplen); + rate_ctr_inc2(conn->client->ctrg, CLIENT_CTR_PKTS); + write_data(conn, msg); } +static struct msgb *osmo_client_conn_prepare_msg_link_pcap(struct osmo_pcap_client_conn *conn) +{ + struct osmo_pcap_data *om_hdr; + struct msgb *msg; + struct osmo_pcap_handle *ph; + int rc; + int linktype; + + ph = llist_first_entry_or_null(&conn->client->handles, struct osmo_pcap_handle, entry); + if (!ph || !ph->handle) { + LOGCONN(conn, LOGL_ERROR, "No pcap_handle not sending link info\n"); + return NULL; + } + linktype = pcap_datalink(ph->handle); + + /* Make sure others have same linktype, .pcap doesn't support different + * linktypes since traffic from all ifaces goes mixed together. */ + llist_for_each_entry(ph, &conn->client->handles, entry) { + if (linktype != pcap_datalink(ph->handle)) { + LOGCONN(conn, LOGL_ERROR, + "File format 'pcap' doesn't support recording from multiple ifaces " + "with different link types! Use VTY config 'pcap file-format pcapng'.\n"); + return NULL; + } + } + + msg = msgb_alloc(sizeof(*om_hdr) + osmo_pcap_file_global_header_size(), "link-data"); + if (!msg) { + LOGP(DCLIENT, LOGL_ERROR, "Failed to allocate data.\n"); + return NULL; + } + + + om_hdr = (struct osmo_pcap_data *)msgb_put(msg, sizeof(*om_hdr)); + om_hdr->type = PKT_LINK_HDR; + + rc = osmo_pcap_file_msgb_append_global_header(msg, conn->client->snaplen, pcap_datalink(ph->handle)); + if (rc < 0) { + LOGP(DCLIENT, LOGL_ERROR, "Failed to create pcap file global header.\n"); + msgb_free(msg); + return NULL; + } + + /* Update payload length: */ + om_hdr->len = htons(rc); + return msg; +} + +struct osmo_pcapng_file_shb_pars shb_pars = { + .hardware = "osmo-pcap hw", + .os = "osmo-pcap os", + .userappl = "osmo-pcap userappl", +}; + +static int pcap_handle_prepare_pcapng_idb_pars(const struct osmo_pcap_handle *ph, + struct osmo_pcapng_file_idb_pars *pars) +{ + struct osmo_pcap_client *client = ph->client; + memset(pars, 0, sizeof(*pars)); + + pars->name = ph->devname; + //pars->filter = client->filter_string; + pars->link_type = pcap_datalink(ph->handle); + pars->snap_len = client->snaplen; + return 0; +} + +static struct msgb *osmo_client_conn_prepare_msg_link_pcapng(struct osmo_pcap_client_conn *conn) +{ + struct osmo_pcap_data *om_hdr; + struct msgb *msg; + struct osmo_pcap_handle *ph; + int rc; + uint32_t file_hdr_size = osmo_pcapng_file_shb_size(&shb_pars); + + /* Calculate size: */ + llist_for_each_entry(ph, &conn->client->handles, entry) { + struct osmo_pcapng_file_idb_pars idb_pars; + if (pcap_handle_prepare_pcapng_idb_pars(ph, &idb_pars) < 0) { + LOGPH(ph, LOGL_ERROR, "Failed preparing pcapng IDB from handle\n"); + return NULL; + } + file_hdr_size += osmo_pcapng_file_idb_size(&idb_pars); + } + + msg = msgb_alloc(sizeof(*om_hdr) + file_hdr_size, "link-data"); + if (!msg) { + LOGCONN(conn, LOGL_ERROR, "Failed to allocate data.\n"); + return NULL; + } + + om_hdr = (struct osmo_pcap_data *)msgb_put(msg, sizeof(*om_hdr)); + om_hdr->type = PKT_LINK_HDR; + + rc = osmo_pcapng_file_msgb_append_shb(msg, &shb_pars); + if (rc < 0) { + LOGCONN(conn, LOGL_ERROR, "Failed to create pcapng SHB\n"); + msgb_free(msg); + return NULL; + } + om_hdr->len = rc; + + llist_for_each_entry(ph, &conn->client->handles, entry) { + struct osmo_pcapng_file_idb_pars idb_pars; + if (pcap_handle_prepare_pcapng_idb_pars(ph, &idb_pars) < 0) { + LOGPH(ph, LOGL_ERROR, "Failed preparing pcapng IDB from handle\n"); + msgb_free(msg); + return NULL; + } + rc = osmo_pcapng_file_msgb_append_idb(msg, &idb_pars); + if (rc < 0) { + LOGPH(ph, LOGL_ERROR, "Failed to append pcapng IDB to msgb\n"); + msgb_free(msg); + return NULL; + } + om_hdr->len += rc; + } + + OSMO_ASSERT(om_hdr->len == file_hdr_size); + om_hdr->len = htons(om_hdr->len); + return msg; +} + void osmo_client_conn_send_link(struct osmo_pcap_client_conn *conn) { - struct osmo_pcap_handle *ph; - struct pcap_file_header *hdr; - struct osmo_pcap_data *om_hdr; struct msgb *msg; /* IPIP encapsulation has no linktype header */ if (conn->protocol == PROTOCOL_IPIP) return; - /* TODO: support capturing from multiple interfaces here: */ - ph = llist_first_entry_or_null(&conn->client->handles, struct osmo_pcap_handle, entry); - if (!ph || !ph->handle) { - LOGCONN(conn, LOGL_ERROR, "No pcap_handle not sending link info\n"); - return; + switch (conn->client->pcap_fmt) { + case OSMO_PCAP_FMT_PCAP: + msg = osmo_client_conn_prepare_msg_link_pcap(conn); + break; + case OSMO_PCAP_FMT_PCAPNG: + msg = osmo_client_conn_prepare_msg_link_pcapng(conn); + break; + default: + OSMO_ASSERT(0); } - msg = msgb_alloc(sizeof(*om_hdr) + sizeof(*hdr), "link-data"); - if (!msg) { - LOGP(DCLIENT, LOGL_ERROR, "Failed to allocate data.\n"); + if (!msg) return; - } - - - om_hdr = (struct osmo_pcap_data *) msgb_put(msg, sizeof(*om_hdr)); - om_hdr->type = PKT_LINK_HDR; - om_hdr->len = htons(sizeof(*hdr)); - - hdr = (struct pcap_file_header *) msgb_put(msg, sizeof(*hdr)); - hdr->magic = 0xa1b2c3d4; - hdr->version_major = 2; - hdr->version_minor = 4; - hdr->thiszone = 0; - hdr->sigfigs = 0; - hdr->snaplen = conn->client->snaplen; - hdr->linktype = pcap_datalink(ph->handle); - write_data(conn, msg); } diff --git a/src/osmo_client_pcap.c b/src/osmo_client_pcap.c new file mode 100644 index 0000000..e7b987e --- /dev/null +++ b/src/osmo_client_pcap.c @@ -0,0 +1,355 @@ +/* + * osmo-pcap-client code + * + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * (C) 2011-2016 by Holger Hans Peter Freyther <holger(a)moiji-mobile.com> + * (C) 2011 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <pcap/pcap.h> + +#include <osmocom/core/msgb.h> + +#include <osmo-pcap/osmo_pcap_client.h> +#include <osmo-pcap/common.h> +#include <osmo-pcap/wireformat.h> + +/*********************************************************** + * Libpcap File Format (.pcap) + * https://wiki.wireshark.org/Development/LibpcapFileFormat + ***********************************************************/ + +/* Get required length to store a Global Header */ +unsigned int osmo_pcap_file_global_header_size(void) +{ + return sizeof(struct pcap_file_header); +} + +/* Appends a Global Header to msg + * returns number of bytes appended on success, negative on error */ +int osmo_pcap_file_msgb_append_global_header(struct msgb *msg, uint32_t snaplen, uint32_t linktype) +{ + struct pcap_file_header *hdr; + + hdr = (struct pcap_file_header *) msgb_put(msg, sizeof(*hdr)); + hdr->magic = 0xa1b2c3d4; + hdr->version_major = 2; + hdr->version_minor = 4; + hdr->thiszone = 0; + hdr->sigfigs = 0; + hdr->snaplen = snaplen; + hdr->linktype = linktype; + + return sizeof(*hdr); +} + +/* Get required length to store a given record (packet) */ +unsigned int osmo_pcap_file_record_size(const struct pcap_pkthdr *in_hdr) +{ + return sizeof(struct osmo_pcap_pkthdr) + in_hdr->caplen; +} + +/* Appends a Record (Packet) Header to msg + * returns number of bytes appended on success, negative on error */ +int osmo_pcap_file_msgb_append_record(struct msgb *msg, const struct pcap_pkthdr *in_hdr, const uint8_t *data) +{ + struct osmo_pcap_pkthdr *hdr; + uint8_t *pkt_payload; + + hdr = (struct osmo_pcap_pkthdr *) msgb_put(msg, sizeof(*hdr)); + hdr->ts_sec = in_hdr->ts.tv_sec; + hdr->ts_usec = in_hdr->ts.tv_usec; + hdr->caplen = in_hdr->caplen; + hdr->len = in_hdr->len; + + pkt_payload = msgb_put(msg, in_hdr->caplen); + memcpy(pkt_payload, data, in_hdr->caplen); + + return osmo_pcap_file_record_size(in_hdr); +} + + +/*********************************************************** + * PCAP Next Generation (pcapng) Capture File Format + * https://wiki.wireshark.org/Development/PcapNg + * https://ietf-opsawg-wg.github.io/draft-ietf-opsawg-pcap/draft-ietf-opsawg-p… + * wireshark.git: wiretap/pcapng.h, wiretap/pcapng.c, wiretap/pcapng_module.h + ***********************************************************/ + +#define BLOCK_TYPE_SHB 0x0A0D0D0A /* Section Header Block */ +#define BLOCK_TYPE_IDB 0x00000001 /* Interface Description Block */ +#define BLOCK_TYPE_PB 0x00000002 /* Packet Block (obsolete) */ +#define BLOCK_TYPE_SPB 0x00000003 /* Simple Packet Block */ +#define BLOCK_TYPE_EPB 0x00000006 /* Enhanced Packet Block */ + +/* Options for all blocks */ +#define OPT_EOFOPT 0 +#define OPT_COMMENT 1 +/* Section Header block (SHB) */ +#define OPT_SHB_HARDWARE 2 +#define OPT_SHB_OS 3 +#define OPT_SHB_USERAPPL 4 + +/* Interface Description block (IDB) */ +#define OPT_IDB_NAME 2 +#define OPT_IDB_DESCRIPTION 3 +#define OPT_IDB_IP4ADDR 4 +#define OPT_IDB_IP6ADDR 5 +#define OPT_IDB_MACADDR 6 +#define OPT_IDB_FILTER 11 + +/* pcapng: common block header file encoding for every block type */ +struct pcapng_block_header { + uint32_t block_type; + uint32_t block_total_length; + /* x bytes block_body */ + /* uint32_t block_total_length */ +} __attribute__((packed)); + +struct pcapng_option_header { + uint16_t type; + uint16_t value_length; +} __attribute__((packed)); + +/* pcapng: section header block file encoding */ +struct pcapng_section_header_block { + /* pcapng_block_header_t */ + uint32_t magic; + uint16_t version_major; + uint16_t version_minor; + uint64_t section_length; /* might be -1 for unknown */ + /* ... Options ... */ +} __attribute__((packed)); + +/* pcapng: interface description block file encoding */ +struct pcapng_iface_descr_block { + uint16_t linktype; + uint16_t reserved; + uint32_t snaplen; + /* ... Options ... */ +} __attribute__((packed)); + +/* pcapng: enhanced packet block file encoding */ +struct pcapng_enhanced_packet_block { + uint32_t interface_id; + uint32_t timestamp_high; + uint32_t timestamp_low; + uint32_t captured_len; + uint32_t packet_len; + /* ... Packet Data ... */ + /* ... Padding ... */ + /* ... Options ... */ +} __attribute__((packed)); + +/* + * Minimum IDB size = minimum block size + size of fixed length portion of IDB. + */ +#define MIN_IDB_SIZE ((uint32_t)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t))) + +/* Get required length to store a given record (packet) */ +static unsigned int osmo_pcapng_file_opt_string_size(const char *str) +{ + size_t str_len = str ? strlen(str) : 0; + uint8_t pad = str_len % 4; + /* Each option is padded to 4 bytes: */ + if (pad) + pad = 4 - pad; + return sizeof(struct pcapng_option_header) + str_len + pad; +} + +static int osmo_pcapng_file_msgb_append_opt_string(struct msgb *msg, uint16_t type, const char *str) +{ + struct pcapng_option_header *opth; + size_t str_len = str ? strlen(str) : 0; + + opth = (struct pcapng_option_header *)msgb_put(msg, sizeof(*opth)); + opth->type = type; + opth->value_length = str_len; + if (str_len > 0) + memcpy(msgb_put(msg, str_len), str, str_len); + + /* Each option is padded to 4 bytes: */ + uint8_t pad = str_len % 4; + if (pad) { + pad = 4 - pad; + uint8_t *buf = (uint8_t *)msgb_put(msg, pad); + memset(buf, 0, pad); + } + return sizeof(*opth) + opth->value_length + pad; +} + +/* Get required length to store a given record (packet) */ +static unsigned int osmo_pcapng_file_opt_eofopt_size(void) +{ + return sizeof(struct pcapng_option_header); +} + +static int osmo_pcapng_file_msgb_append_opt_eofopt(struct msgb *msg) +{ + struct pcapng_option_header *opth; + + opth = (struct pcapng_option_header *)msgb_put(msg, sizeof(*opth)); + opth->type = OPT_EOFOPT; + opth->value_length = 0; + + return sizeof(*opth); +} + +/* Get required length to store a given record (packet) */ +unsigned int osmo_pcapng_file_shb_size(const struct osmo_pcapng_file_shb_pars *pars) +{ + uint32_t block_total_len = sizeof(struct pcapng_block_header) + + sizeof(struct pcapng_section_header_block) + + sizeof(uint32_t); + block_total_len += osmo_pcapng_file_opt_string_size(pars->hardware); + block_total_len += osmo_pcapng_file_opt_string_size(pars->os); + block_total_len += osmo_pcapng_file_opt_string_size(pars->userappl); + block_total_len += osmo_pcapng_file_opt_eofopt_size(); + return block_total_len; +} + +/* Appends a Section Header Block (SHB) to msg + * returns number of bytes appended on success, negative on error */ +int osmo_pcapng_file_msgb_append_shb(struct msgb *msg, const struct osmo_pcapng_file_shb_pars *pars) +{ + struct pcapng_block_header *bh; + struct pcapng_section_header_block *shb; + uint8_t *footer_len; + uint32_t block_total_len = osmo_pcapng_file_shb_size(pars); + + bh = (struct pcapng_block_header *)msgb_put(msg, sizeof(*bh)); + bh->block_type = BLOCK_TYPE_SHB; + bh->block_total_length = block_total_len; + + /* write block fixed content */ + shb = (struct pcapng_section_header_block *)msgb_put(msg, sizeof(*shb)); + shb->magic = 0x1A2B3C4D; + shb->version_major = 1; + shb->version_minor = 0; + shb->section_length = -1; + + /* Options (variable) */ + osmo_pcapng_file_msgb_append_opt_string(msg, OPT_SHB_HARDWARE, pars->hardware); + osmo_pcapng_file_msgb_append_opt_string(msg, OPT_SHB_OS, pars->os); + osmo_pcapng_file_msgb_append_opt_string(msg, OPT_SHB_USERAPPL, pars->userappl); + osmo_pcapng_file_msgb_append_opt_eofopt(msg); + + /* SHB Block Total Length */ + footer_len = (uint8_t *)msgb_put(msg, sizeof(uint32_t)); + memcpy(footer_len, &block_total_len, sizeof(uint32_t)); + + return block_total_len; +} + +unsigned int osmo_pcapng_file_idb_size(const struct osmo_pcapng_file_idb_pars *pars) +{ + uint32_t block_total_len = sizeof(struct pcapng_block_header) + + sizeof(struct pcapng_iface_descr_block) + + sizeof(uint32_t); + block_total_len += osmo_pcapng_file_opt_string_size(pars->name); + //block_total_len += osmo_pcapng_file_opt_string_size(pars->filter); + block_total_len += osmo_pcapng_file_opt_eofopt_size(); + return block_total_len; +} + +int osmo_pcapng_file_msgb_append_idb(struct msgb *msg, const struct osmo_pcapng_file_idb_pars *pars) +{ + struct pcapng_block_header *bh; + struct pcapng_iface_descr_block *idb; + uint8_t *footer_len; + uint32_t block_total_len = osmo_pcapng_file_idb_size(pars); + + bh = (struct pcapng_block_header *)msgb_put(msg, sizeof(*bh)); + bh->block_type = BLOCK_TYPE_IDB; + bh->block_total_length = block_total_len; + + /* write block fixed content */ + idb = (struct pcapng_iface_descr_block *)msgb_put(msg, sizeof(*idb)); + idb->linktype = pars->link_type; + idb->reserved = 0; + idb->snaplen = pars->snap_len; + + /* Options (variable) */ + osmo_pcapng_file_msgb_append_opt_string(msg, OPT_IDB_NAME, pars->name); + // TODO: filter is not a string opt, it has an extra prepended byte.... + //osmo_pcapng_file_msgb_append_opt_string(msg, OPT_IDB_FILTER, pars->filter); + osmo_pcapng_file_msgb_append_opt_eofopt(msg); + + /* IDB Block Total Length */ + footer_len = (uint8_t *)msgb_put(msg, sizeof(uint32_t)); + memcpy(footer_len, &block_total_len, sizeof(uint32_t)); + + return block_total_len; +} + +unsigned int osmo_pcapng_file_epb_size(const struct osmo_pcapng_file_epb_pars *pars) +{ + uint32_t block_total_len = sizeof(struct pcapng_block_header) + + sizeof(struct pcapng_enhanced_packet_block) + + pars->captured_len + + sizeof(uint32_t); + /* Packet data is padded to 4 bytes: */ + uint8_t pad = pars->captured_len % 4; + if (pad) + block_total_len += (4 - pad); + + /* TODO: other Options */ + block_total_len += osmo_pcapng_file_opt_eofopt_size(); + return block_total_len; +} + +int osmo_pcapng_file_msgb_append_epb(struct msgb *msg, const struct osmo_pcapng_file_epb_pars *pars) +{ + struct pcapng_block_header *bh; + struct pcapng_enhanced_packet_block *epb; + uint8_t *footer_len; + uint32_t block_total_len = osmo_pcapng_file_epb_size(pars); + + bh = (struct pcapng_block_header *)msgb_put(msg, sizeof(*bh)); + bh->block_type = BLOCK_TYPE_EPB; + bh->block_total_length = block_total_len; + + /* write block fixed content */ + epb = (struct pcapng_enhanced_packet_block *)msgb_put(msg, sizeof(*epb)); + epb->interface_id = pars->interface_id; + epb->timestamp_high = 0; /* TODO: apply... */ + epb->timestamp_low = 0; /* TODO: apply... */ + epb->captured_len = pars->captured_len; + epb->packet_len = pars->packet_len; + + /* Packet Data */ + if (pars->captured_len > 0) + memcpy(msgb_put(msg, pars->captured_len), pars->captured_data, pars->captured_len); + + /* Each option is padded to 4 bytes: */ + uint8_t pad = pars->captured_len % 4; + if (pad) { + pad = 4 - pad; + uint8_t *buf = (uint8_t *)msgb_put(msg, pad); + memset(buf, 0, pad); + } + + /* Options (variable) */ + osmo_pcapng_file_msgb_append_opt_eofopt(msg); + + /* EPB Block Total Length */ + footer_len = (uint8_t *)msgb_put(msg, sizeof(uint32_t)); + memcpy(footer_len, &block_total_len, sizeof(uint32_t)); + + return block_total_len; +} diff --git a/src/osmo_client_vty.c b/src/osmo_client_vty.c index 009c735..1824324 100644 --- a/src/osmo_client_vty.c +++ b/src/osmo_client_vty.c @@ -1,6 +1,7 @@ /* * osmo-pcap-client code * + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> * (C) 2011-2016 by Holger Hans Peter Freyther <holger(a)moiji-mobile.com> * (C) 2011 by On-Waves * All Rights Reserved @@ -130,6 +131,8 @@ vty_out(vty, "client%s", VTY_NEWLINE); + if (pcap_client->pcap_fmt != OSMO_PCAP_FMT_PCAP) + vty_out(vty, " pcap file-format pcapng%s", VTY_NEWLINE); llist_for_each_entry(ph, &pcap_client->handles, entry) { vty_out(vty, " pcap device %s%s", ph->devname, VTY_NEWLINE); @@ -150,6 +153,22 @@ return CMD_SUCCESS; } +DEFUN(cfg_client_pcap_file_format, + cfg_client_pcap_file_format_cmd, + "pcap file-format (pcap|pcapng)", + PCAP_STRING "The pcap file format to use\n" + "Libpcap Capture File Format (.pcap)\n" + "PCAP Next Generation Capture File Format (.pcapng)\n") +{ + if (strcmp(argv[0], "pcap") == 0) + pcap_client->pcap_fmt = OSMO_PCAP_FMT_PCAP; + else if (strcmp(argv[0], "pcapng") == 0) + pcap_client->pcap_fmt = OSMO_PCAP_FMT_PCAPNG; + else + return CMD_WARNING; + return CMD_SUCCESS; +} + DEFUN(cfg_client_no_device, cfg_client_no_device_cmd, "no pcap device NAME", @@ -559,6 +578,7 @@ install_node(&server_node, config_write_server); + install_element(CLIENT_NODE, &cfg_client_pcap_file_format_cmd); install_element(CLIENT_NODE, &cfg_client_no_device_cmd); install_element(CLIENT_NODE, &cfg_client_device_cmd); install_element(CLIENT_NODE, &cfg_client_snaplen_cmd); diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c index 9750170..86afc90 100644 --- a/src/osmo_server_network.c +++ b/src/osmo_server_network.c @@ -108,7 +108,7 @@ talloc_free(event_name); pcap_zmq_send(conn->server->zmq_publ, - &conn->file_hdr, sizeof(conn->file_hdr), + conn->file_hdr, conn->file_hdr_len, ZMQ_SNDMORE); pcap_zmq_send(conn->server->zmq_publ, &data->data[0], data->len, @@ -285,8 +285,8 @@ return; } - rc = write(conn->local_fd, &conn->file_hdr, sizeof(conn->file_hdr)); - if (rc != sizeof(conn->file_hdr)) { + rc = write(conn->local_fd, conn->file_hdr, conn->file_hdr_len); + if (rc != conn->file_hdr_len) { LOGP(DSERVER, LOGL_ERROR, "Failed to write the header: %d\n", errno); close(conn->local_fd); conn->local_fd = -1; @@ -298,6 +298,8 @@ static int link_data(struct osmo_pcap_conn *conn, struct osmo_pcap_data *data) { +#if 0 + /* TODO: discover pcap vs pcapng based on "magic" field. Check minimum size. */ struct pcap_file_header *hdr; hdr = (struct pcap_file_header *) &data->data[0]; @@ -308,12 +310,20 @@ (size_t) hdr->snaplen, (size_t) conn->server->max_snaplen); return -1; } +#endif if (!conn->no_store && conn->local_fd < 0) { - conn->file_hdr = *hdr; + TALLOC_FREE(conn->file_hdr); + conn->file_hdr = talloc_size(conn, data->len); + memcpy(conn->file_hdr, data->data, data->len); + conn->file_hdr_len = data->len; restart_pcap(conn); - } else if (memcmp(&conn->file_hdr, hdr, sizeof(*hdr)) != 0) { - conn->file_hdr = *hdr; + } else if (conn->file_hdr_len != data->len || + memcmp(&conn->file_hdr, data->data, data->len) != 0) { + TALLOC_FREE(conn->file_hdr); + conn->file_hdr = talloc_size(conn, data->len); + memcpy(conn->file_hdr, data->data, data->len); + conn->file_hdr_len = data->len; restart_pcap(conn); } @@ -583,9 +593,10 @@ unsigned int min_len, max_len; switch ((enum OsmoPcapDataType) conn->data->type) { case PKT_LINK_HDR: - if (conn->data->len != sizeof(struct pcap_file_header)) { + /* TODO: discover pcap vs pcapng based on "magic" field. */ + if (conn->data->len < sizeof(struct pcap_file_header)) { LOGP(DSERVER, LOGL_ERROR, - "Implausible llink_hdr length: %u != %zu\n", + "Implausible llink_hdr length: %u < %zu\n", conn->data->len, sizeof(struct osmo_pcap_pkthdr)); return false; } @@ -747,7 +758,8 @@ { close_connection(client); - memset(&client->file_hdr, 0, sizeof(client->file_hdr)); + TALLOC_FREE(client->file_hdr); + client->file_hdr_len = 0; client->rem_wq.bfd.fd = new_fd; if (osmo_fd_register(&client->rem_wq.bfd) != 0) { LOGP(DSERVER, LOGL_ERROR, "Failed to register fd.\n"); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39265?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I3c80518a1e53a1f77e1aca8dfa83f683f9516ad6 Gerrit-Change-Number: 39265 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: SGSN: f_cellid_to_RAI: fix spaces vs tabs
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39253?usp=email ) Change subject: SGSN: f_cellid_to_RAI: fix spaces vs tabs ...................................................................... SGSN: f_cellid_to_RAI: fix spaces vs tabs Change-Id: Ic1927729dd0d205f1bd866423c8dfdf91caf597d --- M sgsn/SGSN_Tests.ttcn 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/39253/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39253?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic1927729dd0d205f1bd866423c8dfdf91caf597d Gerrit-Change-Number: 39253 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: SGSN: add TC_attach_gmm_attach_req_while_gmm_attach_changed
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39256?usp=email ) Change subject: SGSN: add TC_attach_gmm_attach_req_while_gmm_attach_changed ...................................................................... SGSN: add TC_attach_gmm_attach_req_while_gmm_attach_changed Add a TC to to simulate multiple GMM Attach with a different content. When receiving a GMM Attach while in an Attach, but with a different message, the old GMM Attach should be discard silently and a new GMM Attach procedure should be initiated. Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc --- M sgsn/SGSN_Tests.ttcn 1 file changed, 70 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/39256/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39256?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc Gerrit-Change-Number: 39256 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: GTPv1C_Templates: add cause code GTP_CAUSE_IMSI_IMEI_NOT_KNOWN
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39263?usp=email ) Change subject: GTPv1C_Templates: add cause code GTP_CAUSE_IMSI_IMEI_NOT_KNOWN ...................................................................... GTPv1C_Templates: add cause code GTP_CAUSE_IMSI_IMEI_NOT_KNOWN It will be used by SGSN Context Req/Resp/Ack test cases in the SGSN. Change-Id: I8f919d5982a3c9a317d309c383b36043ad5d3278 --- M library/GTPv1C_Templates.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/39263/1 diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn index 7371ab0..fd55af6 100644 --- a/library/GTPv1C_Templates.ttcn +++ b/library/GTPv1C_Templates.ttcn @@ -71,6 +71,7 @@ /* reserved */ GTP_CAUSE_REQUEST_ACCEPTED (128), GTP_CAUSE_INVALID_MSG_FORMAT (193), + GTP_CAUSE_IMSI_IMEI_NOT_KNOWN (194), GTP_CAUSE_NO_RESOURCES_AVAILABLE (199) /* FIXME */ } with { encode "RAW" -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39263?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I8f919d5982a3c9a317d309c383b36043ad5d3278 Gerrit-Change-Number: 39263 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: L3_Templates: add MM cause codes
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39264?usp=email ) Change subject: L3_Templates: add MM cause codes ...................................................................... L3_Templates: add MM cause codes It will be used by SGSN Context Req/Resp/Ack test cases in the SGSN. Change-Id: I396ddaf5b08faddcf002317307dcc20840898aa9 --- M library/L3_Templates.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/39264/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 1f868db..7cf82a3 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -53,6 +53,10 @@ SERVICE_TYPE_MBMS_Broadcast_Service_Reception ('100'B) } +/* TS 24.008 Table 10.5.147; Annex G, both MM and GMM cause code (8 bits) */ +const OCT1 c_MM_CAUSE_IMSI_UNKNOWN_IN_HLR := '02'O; +const OCT1 c_MM_CAUSE_MS_NOT_DERIVED := '09'O; + template ML3_Cause_TLV ts_ML3_Cause(BIT7 cause, BIT4 loc := '0001'B, BIT2 std := '11'B) := { elementIdentifier := '08'O, lengthIndicator := 0, /* overwritten */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39264?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I396ddaf5b08faddcf002317307dcc20840898aa9 Gerrit-Change-Number: 39264 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: SGSN: add testcases for PDP Context Status
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39262?usp=email ) Change subject: SGSN: add testcases for PDP Context Status ...................................................................... SGSN: add testcases for PDP Context Status Both the network and the UE can add a TLV which describes the active PDPs from their perspective. Change-Id: I5a29e667f53cc2834fbddd2c5dc901d3e6ae72c7 --- M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 219 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/39262/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 9551845..1f868db 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -341,12 +341,33 @@ }; /* TS 24.008 10.5.7.1 PDPContextStatus */ -template (value) PDPContextStatusTLV ts_PDPContextStatusTLV(template (value) OCT2 status := '0000'O /* all inactive */) := { - elementIdentifier := '32'O, - lengthIndicator := 0, /* overwritten */ - valueField := status -}; +function tr_PDPContextStatusTLV(template OCT2 status := *) return template PDPContextStatusTLV { + if (istemplatekind(status, "omit")) { + return omit; + } else if (istemplatekind(status, "*")) { + return *; + } else { + var template PDPContextStatusTLV ret := { + elementIdentifier := '32'O, + lengthIndicator := ?, + valueField := status + }; + return ret; + } +} +function ts_PDPContextStatusTLV(template (omit) OCT2 status := omit) return template (omit) PDPContextStatusTLV { + if (istemplatekind(status, "omit")) { + return omit; + } else { + var template (omit) PDPContextStatusTLV ret := { + elementIdentifier := '32'O, + lengthIndicator := 0, /* overwritten */ + valueField := status + }; + return ret; + } +} /* Send template for LOCATION UPDATING REQUEST */ template (value) PDU_ML3_MS_NW ts_LU_REQ(template (value) LocationUpdatingType lu_type, @@ -2648,7 +2669,8 @@ template (omit) P_TMSI_TypeTV p_tmsi_type := omit, template (omit) MobileIdentityTLV add_p_tmsi := omit, template (omit) RoutingAreaIdentification2TLV add_rai := omit, - template (omit) MSNetworkCapabilityV ms_network_cap := omit + template (omit) MSNetworkCapabilityV ms_network_cap := omit, + template (omit) OCT2 pdp_status := omit ) := { discriminator := '0000'B, /* overwritten */ tiOrSkip := { @@ -2668,7 +2690,7 @@ tmsiStatus := omit, ptmsi := ts_MI_TMSI_TLV(p_tmsi), mSNetworkCapability := ts_GMM_MsNetCapTLV(ms_network_cap), - pdpContextStatus := omit, /* TODO */ + pdpContextStatus := ts_PDPContextStatusTLV(pdp_status), pC_LCSCapability := omit, mBMS_ContextStatus := omit, uENetworkCapability := omit, @@ -2715,7 +2737,9 @@ template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?, template RoutingAreaIdentificationV ra := ?, - template OCT4 ptmsi := *) := { + template OCT4 ptmsi := *, + template OCT2 pdp_status := * + ) := { discriminator := '1000'B, tiOrSkip := { skipIndicator := '0000'B @@ -2737,7 +2761,7 @@ t3302 := *, cellNotification := *, equivalentPLMNs := *, - pdpContextStatus := *, + pdpContextStatus := tr_PDPContextStatusTLV(pdp_status), networkFeatureSupport := *, emergencyNumberList := *, mBMS_ContextStatus := *, diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index ca99a02..6efc446 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2579,6 +2579,189 @@ f_cleanup(); } +private function f_TC_attach_pdp_act_rau_pdp_ctx_status_same(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var PDU_L3_SGSN_MS l3_mt; + var integer ran_index := 0; + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + + f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra := g_pars.ra, pdp_status := '2000'O /* NSAPI 5 */), ran_index); + + timer T := 2.0; + T.start; + alt { + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT(pdp_status := '2000'O)) -> value l3_mt { + f_process_rau_accept(l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, ran_index); + f_send_l3(ts_GMM_RAU_COMPL, ran_index); + setverdict(pass); + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT) { + setverdict(fail, "Rx RAU ACCEPT with wrong PDP status"); + mtc.stop; + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_REJECT); + [] BSSGP[ran_index].receive(tr_LLC_XID_MT_CMD(?, ?)) { + /* Ignore XID Reset */ + repeat; + } + [] as_gmm_auth(ran_index := ran_index, expect_sai := true) { repeat; }; + [] T.timeout { + setverdict(fail, "Timeout rx RAU Reject"); + mtc.stop; + } + } +} + +/* Attach, RAU with PDP Ctx Status */ +testcase TC_attach_pdp_act_rau_pdp_ctx_status_same() runs on test_CT { + /* MS <-> SGSN: Attach Procedure + * MS <-> SGSN: PDP Activate + * MS -> SGSN: RAU Request with PDP Ctx status + * MS <-> SGSN: Auth... + * MS <- SGSN: RAU Accept with PDP Ctx status + * MS -> SGSN: RAU Complete + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_rau_pdp_ctx_status_same), testcasename(), g_gb, 26); + vc_conn.done; + f_cleanup(); +} + +private function f_TC_attach_pdp_act_rau_pdp_ctx_status_ue_more(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var PDU_L3_SGSN_MS l3_mt; + var integer ran_index := 0; + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + + f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra := g_pars.ra, pdp_status := '6000'O /* NSAPI 5,6 */), ran_index); + + timer T := 2.0; + T.start; + alt { + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT(pdp_status := '2000'O)) -> value l3_mt { + f_process_rau_accept(l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, ran_index); + f_send_l3(ts_GMM_RAU_COMPL, ran_index); + setverdict(pass); + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT) { + setverdict(fail, "Rx RAU ACCEPT with wrong PDP status"); + mtc.stop; + } + [] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_REQ_MT(?, ?)) { + setverdict(fail, "Rx unexpected Deact PDP Req"); + mtc.stop; + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_REJECT); + [] BSSGP[ran_index].receive(tr_LLC_XID_MT_CMD(?, ?)) { + /* Ignore XID Reset */ + repeat; + } + [] as_gmm_auth(ran_index := ran_index, expect_sai := true) { repeat; }; + [] T.timeout { + setverdict(fail, "Timeout rx RAU Reject"); + mtc.stop; + } + } +} + +/* Attach, RAU with PDP Ctx Status */ +testcase TC_attach_pdp_act_rau_pdp_ctx_status_ue_more() runs on test_CT { + /* MS <-> SGSN: Attach Procedure + * MS <-> SGSN: PDP Activate + * MS -> SGSN: RAU Request with PDP Ctx status (more PDP Ctx than expected) + * MS <-> SGSN: Auth... + * MS <- SGSN: RAU Accept with PDP Ctx status + * MS -> SGSN: RAU Complete + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_rau_pdp_ctx_status_ue_more), testcasename(), g_gb, 26); + vc_conn.done; + f_cleanup(); +} + +private function f_TC_attach_pdp_act_rau_pdp_ctx_status_ue_less(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var PDU_L3_SGSN_MS l3_mt; + var integer ran_index := 0; + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + + f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra := g_pars.ra, pdp_status := '0000'O), ran_index); + + timer T := 2.0; + T.start; + alt { + [] as_ggsn_gtp_ctx_del_req(apars) {} + [] as_gmm_auth(ran_index := ran_index, expect_sai := true) { repeat; }; + [] BSSGP[ran_index].receive(tr_LLC_XID_MT_CMD(?, ?)) { + /* Ignore XID Reset */ + repeat; + } + [] T.timeout { + setverdict(fail, "Timeout rx RAU Reject"); + mtc.stop; + } + } + + T.start; + alt { + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT(pdp_status := '0000'O)) -> value l3_mt { + f_process_rau_accept(l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, ran_index); + f_send_l3(ts_GMM_RAU_COMPL, ran_index); + setverdict(pass); + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_ACCEPT) { + setverdict(fail, "Rx RAU ACCEPT with wrong PDP status"); + mtc.stop; + } + [] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_REQ_MT(?, ?)) { + setverdict(fail, "Rx unexpected Deact PDP Req"); + mtc.stop; + } + [] BSSGP[ran_index].receive(tr_GMM_RAU_REJECT); + [] BSSGP[ran_index].receive(tr_LLC_XID_MT_CMD(?, ?)) { + /* Ignore XID Reset */ + repeat; + } + [] as_gmm_auth(ran_index := ran_index, expect_sai := true) { repeat; }; + [] T.timeout { + setverdict(fail, "Timeout rx RAU Reject"); + mtc.stop; + } + } +} + +/* Attach, RAU with PDP Ctx Status */ +testcase TC_attach_pdp_act_rau_pdp_ctx_status_ue_less() runs on test_CT { + /* MS <-> SGSN: Attach Procedure + * MS <-> SGSN: PDP Activate + * MS -> SGSN: RAU Request with PDP Ctx status (less PDP Ctx than expected) + * MS <-> SGSN: Auth... + * SGSN -> GGSN: close PDP without notifing the MS + * MS <- SGSN: RAU Accept with PDP Ctx status + * MS -> SGSN: RAU Complete + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_rau_pdp_ctx_status_ue_less), testcasename(), g_gb, 26); + vc_conn.done; + f_cleanup(); +} + + private function f_TC_attach_req_id_req_ra_update(charstring id) runs on BSSGP_ConnHdlr { var RoutingAreaIdentificationV old_ra := f_random_RAI(); var RoutingAreaIdentificationV new_ra := f_random_RAI(); @@ -3475,6 +3658,9 @@ execute( TC_attach_pdp_act_deact_gtp_retrans_resp() ); execute( TC_attach_pdp_act_user_error_ind_ggsn() ); execute( TC_attach_pdp_act_gmm_detach() ); + execute( TC_attach_pdp_act_rau_pdp_ctx_status_same() ); + execute( TC_attach_pdp_act_rau_pdp_ctx_status_ue_more() ); + execute( TC_attach_pdp_act_rau_pdp_ctx_status_ue_less() ); execute( TC_attach_gmm_attach_req_while_gmm_attach() ); execute( TC_attach_gmm_attach_req_while_gmm_attach_retransmit() ); execute( TC_attach_gmm_attach_req_while_gmm_attach_changed() ); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39262?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I5a29e667f53cc2834fbddd2c5dc901d3e6ae72c7 Gerrit-Change-Number: 39262 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: SGSN: TC_attach_gsup_lu_timeout: increase timeout to 35 seconds
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39257?usp=email ) Change subject: SGSN: TC_attach_gsup_lu_timeout: increase timeout to 35 seconds ...................................................................... SGSN: TC_attach_gsup_lu_timeout: increase timeout to 35 seconds Currently the SGSN times out after 30 seconds. Change-Id: Ie882dd39f3c606e5fe00162fcf17c47b9f713d49 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/39257/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 6f9f648..703315f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -758,7 +758,7 @@ var BSSGP_ConnHdlr vc_conn; f_init(); f_sleep(1.0); - vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb, 5); + vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb, 5, t_guard := 35.0); vc_conn.done; f_cleanup(); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39257?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ie882dd39f3c606e5fe00162fcf17c47b9f713d49 Gerrit-Change-Number: 39257 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: SGSN: TC_attach_auth_sai_timeout: increase t_guard to 35 seconds
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39258?usp=email ) Change subject: SGSN: TC_attach_auth_sai_timeout: increase t_guard to 35 seconds ...................................................................... SGSN: TC_attach_auth_sai_timeout: increase t_guard to 35 seconds Currently the SGSN times out after 30 seconds. Change-Id: Iaef1853f1e5f9b99fedbdfbed597ffa79b9e758a --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/39258/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 703315f..51fc52d 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -706,7 +706,7 @@ testcase TC_attach_auth_sai_timeout() runs on test_CT { var BSSGP_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_timeout), testcasename(), g_gb, 3); + vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_timeout), testcasename(), g_gb, 3, t_guard := 35.0); vc_conn.done; f_cleanup(); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39258?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iaef1853f1e5f9b99fedbdfbed597ffa79b9e758a Gerrit-Change-Number: 39258 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: SGSN: TC_attach_timeout_after_pdp_act: expect SAI when doing auth
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39259?usp=email ) Change subject: SGSN: TC_attach_timeout_after_pdp_act: expect SAI when doing auth ...................................................................... SGSN: TC_attach_timeout_after_pdp_act: expect SAI when doing auth While doing an attach, a authentication should happen. Change-Id: I46853723ecb43f4809e8c292ec5c4cc5d872ad2f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/39259/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 51fc52d..43da288 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -615,7 +615,7 @@ T.start(1.0); alt { - [] as_gmm_auth(ran_index := ran_index) { repeat; }; + [] as_gmm_auth(ran_index := ran_index, expect_sai := true) { repeat; }; [] as_gmm_gsup_lu_isd(); [] as_mm_identity(ran_index); [] as_xid(apars, ran_index); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39259?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I46853723ecb43f4809e8c292ec5c4cc5d872ad2f Gerrit-Change-Number: 39259 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: add TC_attach_gmm_attach_req_while_gmm_attach_changed
by lynxis lazus 08 Jan '25

08 Jan '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39256?usp=email ) Change subject: sgsn: add TC_attach_gmm_attach_req_while_gmm_attach_changed ...................................................................... sgsn: add TC_attach_gmm_attach_req_while_gmm_attach_changed Add a TC to to simulate multiple GMM Attach with a different content. When receiving a GMM Attach while in an Attach, but with a different message, the old GMM Attach should be discard silently and a new GMM Attach procedure should be initiated. Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc --- M sgsn/SGSN_Tests.ttcn 1 file changed, 70 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/39256/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 71b55c7..6f9f648 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2171,6 +2171,75 @@ f_cleanup(); } +/* Do a Attach Req with P-TMSI, on ID Req, change Attach Req, should terminate the procedure and do it again */ +private function f_TC_attach_gmm_attach_req_while_gmm_attach_changed(charstring id) runs on BSSGP_ConnHdlr { + var integer count_req := 0; + var MobileL3_CommonIE_Types.MobileIdentityLV mi; + var RoutingAreaIdentificationV rand_rai := f_random_RAI(); + var PDU_L3_SGSN_MS l3_mt; + + g_pars.vec := f_gen_auth_vec_3g(); + g_pars.p_tmsi := f_random_ptmsi(suffix := '01'O); + + f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit)); + + alt { + [] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) { + setverdict(fail, "Unexpected GMM ATTACH REJECT"); + mtc.stop; + } + [] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) { + mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + /* Changing the GMM Attach Req to reset the GMM Attach procedure */ + f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit, + p_tmsi_type := ts_PtmsiTypeTV(c_GMM_PMTSI_TYPE_NATIVE))); + } + } + + alt { + [] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) { + setverdict(fail, "Unexpected GMM ATTACH REJECT"); + mtc.stop; + } + [] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) { + mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + f_send_l3(ts_GMM_ID_RESP(mi)); + repeat; + } + [] as_gmm_auth(umts_aka_challenge := true, expect_sai := true) { repeat; }; + [] as_gmm_gsup_lu_isd() { repeat; }; + [] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt { + f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept); + f_send_l3(ts_GMM_ATTACH_COMPL); + setverdict(pass); + /* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */ + } + } +} + +/* Do a Attach Req with P-TMSI, on ID Req, change Attach Req */ +testcase TC_attach_gmm_attach_req_while_gmm_attach_changed() runs on test_CT { + /* Testing if the SGSN ignore Attach Request with the exact same content */ + /* MS -> SGSN: Attach Request TMSI + * MS <- SGSN: Identity Request IMSI + * MS -> SGSN: Attach Request (2nd) + * MS <- SGSN: Identity Request IMSI (retrans) + * SGSN -> HLR: SAI Request + * SGSN <- HLR: SAI Response + * MS <- SGSN: Auth Req + * MS <- SGSN: Auth Resp + * SGSN <-> HLR: ULA/ISD + * MS <- SGSN: Attach Accept + * MS -> SGSN: Attach Complete + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_gmm_attach_req_while_gmm_attach_changed), testcasename(), g_gb, 39); + vc_conn.done; + f_cleanup(); +} + private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr { var RoutingAreaIdentificationV old_ra := f_random_RAI(); @@ -3460,6 +3529,7 @@ execute( TC_attach_pdp_act_gmm_detach() ); execute( TC_attach_gmm_attach_req_while_gmm_attach() ); execute( TC_attach_gmm_attach_req_while_gmm_attach_retransmit() ); + execute( TC_attach_gmm_attach_req_while_gmm_attach_changed() ); execute( TC_xid_empty_l3() ); execute( TC_xid_n201u() ); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39256?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc Gerrit-Change-Number: 39256 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.