blob: 288b229e634b27c55739b280448e7b72df702d39 [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);
Neels Hofmeyr9e57a5a2015-12-21 11:20:14 +010014
15/* Compose a string of the form '<ni>.mnc001.mcc002.gprs\0', returned in a
16 * static buffer. */
Harald Welte908085c2014-10-01 16:18:11 +080017char *osmo_apn_qualify_from_imsi(const char *imsi,
18 const char *ni, int have_3dig_mnc);
Jacob Erlbeck81142942015-11-17 08:42:05 +010019
20int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char *str);
Philipp Maier8a942d22018-12-07 11:00:59 +010021char *osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t apn_enc_len);