blob: 7899bb28d371e7c29b14f223cc7f000784edcf58 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file apn.h */
2
Harald Welte908085c2014-10-01 16:18:11 +08003#pragma once
4
5#include <stdint.h>
6
7/* 23.003 Section 9.1.1, excluding any terminating zero byte */
8#define APN_NI_MAXLEN 63
9
10/* 23.003 Section 9.1, excluding any terminating zero byte */
11#define APN_MAXLEN 100
12
13char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni);
Harald Welte4a62eda2019-03-18 18:27:00 +010014char *osmo_apn_qualify_buf(char *buf, size_t buf_len, unsigned int mcc, unsigned int mnc, const char *ni);
Neels Hofmeyr9e57a5a2015-12-21 11:20:14 +010015
16/* Compose a string of the form '<ni>.mnc001.mcc002.gprs\0', returned in a
17 * static buffer. */
Harald Welte908085c2014-10-01 16:18:11 +080018char *osmo_apn_qualify_from_imsi(const char *imsi,
19 const char *ni, int have_3dig_mnc);
Harald Welte4a62eda2019-03-18 18:27:00 +010020char *osmo_apn_qualify_from_imsi_buf(char *buf, size_t buf_len, const char *imsi,
21 const char *ni, int have_3dig_mnc);
Jacob Erlbeck81142942015-11-17 08:42:05 +010022
23int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char *str);
Philipp Maier8a942d22018-12-07 11:00:59 +010024char *osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t apn_enc_len);