Changeset 474d19f5c00f6224852e28606dbe4f2e455198c0

Show
Ignore:
Timestamp:
03/02/10 23:18:30 (6 months ago)
Author:
Harald Welte <laforge@gnumonks.org>
Parents:
2e411c7b0d24639968b0e551f4bf1c1e2627caf7
Children:
3c9c5f941d6053985a3fb2aaea2774a24df1bfd3
git-committer:
Harald Welte <laforge@gnumonks.org> / 2010-03-02T23:18:30Z+0100
Message:

remove gsm04.08 utility code that has been moved to libosmocore

Location:
openbsc
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • openbsc/include/openbsc/gsm_04_08.h

    r13f5297 r474d19f  
    55 
    66#include <osmocore/protocol/gsm_04_08.h> 
     7#include <osmocore/gsm48.h> 
    78 
    89struct msgb; 
  • openbsc/src/gsm_04_08.c

    rdfe6c7d r474d19f  
    5858 
    5959void *tall_locop_ctx; 
    60  
    61 static const struct tlv_definition rsl_att_tlvdef = { 
    62         .def = { 
    63                 [GSM48_IE_MOBILE_ID]    = { TLV_TYPE_TLV }, 
    64                 [GSM48_IE_NAME_LONG]    = { TLV_TYPE_TLV }, 
    65                 [GSM48_IE_NAME_SHORT]   = { TLV_TYPE_TLV }, 
    66                 [GSM48_IE_UTC]          = { TLV_TYPE_TV }, 
    67                 [GSM48_IE_NET_TIME_TZ]  = { TLV_TYPE_FIXED, 7 }, 
    68                 [GSM48_IE_LSA_IDENT]    = { TLV_TYPE_TLV }, 
    69  
    70                 [GSM48_IE_BEARER_CAP]   = { TLV_TYPE_TLV }, 
    71                 [GSM48_IE_CAUSE]        = { TLV_TYPE_TLV }, 
    72                 [GSM48_IE_CC_CAP]       = { TLV_TYPE_TLV }, 
    73                 [GSM48_IE_ALERT]        = { TLV_TYPE_TLV }, 
    74                 [GSM48_IE_FACILITY]     = { TLV_TYPE_TLV }, 
    75                 [GSM48_IE_PROGR_IND]    = { TLV_TYPE_TLV }, 
    76                 [GSM48_IE_AUX_STATUS]   = { TLV_TYPE_TLV }, 
    77                 [GSM48_IE_NOTIFY]       = { TLV_TYPE_TV }, 
    78                 [GSM48_IE_KPD_FACILITY] = { TLV_TYPE_TV }, 
    79                 [GSM48_IE_SIGNAL]       = { TLV_TYPE_TV }, 
    80                 [GSM48_IE_CONN_BCD]     = { TLV_TYPE_TLV }, 
    81                 [GSM48_IE_CONN_SUB]     = { TLV_TYPE_TLV }, 
    82                 [GSM48_IE_CALLING_BCD]  = { TLV_TYPE_TLV }, 
    83                 [GSM48_IE_CALLING_SUB]  = { TLV_TYPE_TLV }, 
    84                 [GSM48_IE_CALLED_BCD]   = { TLV_TYPE_TLV }, 
    85                 [GSM48_IE_CALLED_SUB]   = { TLV_TYPE_TLV }, 
    86                 [GSM48_IE_REDIR_BCD]    = { TLV_TYPE_TLV }, 
    87                 [GSM48_IE_REDIR_SUB]    = { TLV_TYPE_TLV }, 
    88                 [GSM48_IE_LOWL_COMPAT]  = { TLV_TYPE_TLV }, 
    89                 [GSM48_IE_HIGHL_COMPAT] = { TLV_TYPE_TLV }, 
    90                 [GSM48_IE_USER_USER]    = { TLV_TYPE_TLV }, 
    91                 [GSM48_IE_SS_VERS]      = { TLV_TYPE_TLV }, 
    92                 [GSM48_IE_MORE_DATA]    = { TLV_TYPE_T }, 
    93                 [GSM48_IE_CLIR_SUPP]    = { TLV_TYPE_T }, 
    94                 [GSM48_IE_CLIR_INVOC]   = { TLV_TYPE_T }, 
    95                 [GSM48_IE_REV_C_SETUP]  = { TLV_TYPE_T }, 
    96                 [GSM48_IE_REPEAT_CIR]   = { TLV_TYPE_T }, 
    97                 [GSM48_IE_REPEAT_SEQ]   = { TLV_TYPE_T }, 
    98                 /* FIXME: more elements */ 
    99         }, 
    100 }; 
    101  
    102 static const char *rr_cause_names[] = { 
    103         [GSM48_RR_CAUSE_NORMAL]                 = "Normal event", 
    104         [GSM48_RR_CAUSE_ABNORMAL_UNSPEC]        = "Abnormal release, unspecified", 
    105         [GSM48_RR_CAUSE_ABNORMAL_UNACCT]        = "Abnormal release, channel unacceptable", 
    106         [GSM48_RR_CAUSE_ABNORMAL_TIMER]         = "Abnormal release, timer expired", 
    107         [GSM48_RR_CAUSE_ABNORMAL_NOACT]         = "Abnormal release, no activity on radio path", 
    108         [GSM48_RR_CAUSE_PREMPTIVE_REL]          = "Preemptive release", 
    109         [GSM48_RR_CAUSE_HNDOVER_IMP]            = "Handover impossible, timing advance out of range", 
    110         [GSM48_RR_CAUSE_CHAN_MODE_UNACCT]       = "Channel mode unacceptable", 
    111         [GSM48_RR_CAUSE_FREQ_NOT_IMPL]          = "Frequency not implemented", 
    112         [GSM48_RR_CAUSE_CALL_CLEARED]           = "Call already cleared", 
    113         [GSM48_RR_CAUSE_SEMANT_INCORR]          = "Semantically incorrect message", 
    114         [GSM48_RR_CAUSE_INVALID_MAND_INF]       = "Invalid mandatory information", 
    115         [GSM48_RR_CAUSE_MSG_TYPE_N]             = "Message type non-existant or not implemented", 
    116         [GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT]      = "Message type not compatible with protocol state", 
    117         [GSM48_RR_CAUSE_COND_IE_ERROR]          = "Conditional IE error", 
    118         [GSM48_RR_CAUSE_NO_CELL_ALLOC_A]        = "No cell allocation available", 
    119         [GSM48_RR_CAUSE_PROT_ERROR_UNSPC]       = "Protocol error unspecified", 
    120 }; 
    121  
    122 static const char *cc_state_names[] = { 
    123         "NULL", 
    124         "INITIATED", 
    125         "illegal state 2", 
    126         "MO_CALL_PROC", 
    127         "CALL_DELIVERED", 
    128         "illegal state 5", 
    129         "CALL_PRESENT", 
    130         "CALL_RECEIVED", 
    131         "CONNECT_REQUEST", 
    132         "MO_TERM_CALL_CONF", 
    133         "ACTIVE", 
    134         "DISCONNECT_REQ", 
    135         "DISCONNECT_IND", 
    136         "illegal state 13", 
    137         "illegal state 14", 
    138         "illegal state 15", 
    139         "illegal state 16", 
    140         "illegal state 17", 
    141         "illegal state 18", 
    142         "RELEASE_REQ", 
    143         "illegal state 20", 
    144         "illegal state 21", 
    145         "illegal state 22", 
    146         "illegal state 23", 
    147         "illegal state 24", 
    148         "illegal state 25", 
    149         "MO_ORIG_MODIFY", 
    150         "MO_TERM_MODIFY", 
    151         "CONNECT_IND", 
    152         "illegal state 29", 
    153         "illegal state 30", 
    154         "illegal state 31", 
    155 }; 
    156  
    157 static char strbuf[64]; 
    158  
    159 static const char *rr_cause_name(u_int8_t cause) 
    160 { 
    161         if (cause < ARRAY_SIZE(rr_cause_names) && 
    162             rr_cause_names[cause]) 
    163                 return rr_cause_names[cause]; 
    164  
    165         snprintf(strbuf, sizeof(strbuf), "0x%02x", cause); 
    166         return strbuf; 
    167 } 
    16860 
    16961int gsm0408_loc_upd_acc(struct gsm_lchan *lchan, u_int32_t tmsi); 
     
    20931985        memset(&setup, 0, sizeof(struct gsm_mncc)); 
    20941986        setup.callref = trans->callref; 
    2095         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     1987        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    20961988        /* emergency setup is identified by msg_type */ 
    20971989        if (msg_type == GSM48_MT_CC_EMERG_SETUP) 
     
    22452137        memset(&call_conf, 0, sizeof(struct gsm_mncc)); 
    22462138        call_conf.callref = trans->callref; 
    2247         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2139        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    22482140#if 0 
    22492141        /* repeat */ 
     
    23132205        memset(&alerting, 0, sizeof(struct gsm_mncc)); 
    23142206        alerting.callref = trans->callref; 
    2315         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2207        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    23162208        /* facility */ 
    23172209        if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { 
     
    24202312        memset(&connect, 0, sizeof(struct gsm_mncc)); 
    24212313        connect.callref = trans->callref; 
    2422         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2314        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    24232315        /* use subscriber as connected party number */ 
    24242316        if (trans->subscr) { 
     
    24932385        memset(&disc, 0, sizeof(struct gsm_mncc)); 
    24942386        disc.callref = trans->callref; 
    2495         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_CAUSE, 0); 
     2387        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_CAUSE, 0); 
    24962388        /* cause */ 
    24972389        if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { 
     
    25802472        memset(&rel, 0, sizeof(struct gsm_mncc)); 
    25812473        rel.callref = trans->callref; 
    2582         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2474        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    25832475        /* cause */ 
    25842476        if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { 
     
    26682560        memset(&rel, 0, sizeof(struct gsm_mncc)); 
    26692561        rel.callref = trans->callref; 
    2670         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2562        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    26712563        /* cause */ 
    26722564        if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { 
     
    27552647        memset(&fac, 0, sizeof(struct gsm_mncc)); 
    27562648        fac.callref = trans->callref; 
    2757         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_FACILITY, 0); 
     2649        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_FACILITY, 0); 
    27582650        /* facility */ 
    27592651        if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { 
     
    28682760        memset(&dtmf, 0, sizeof(struct gsm_mncc)); 
    28692761        dtmf.callref = trans->callref; 
    2870         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0); 
     2762        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); 
    28712763        /* keypad facility */ 
    28722764        if (TLVP_PRESENT(&tp, GSM48_IE_KPD_FACILITY)) { 
     
    29402832        memset(&modify, 0, sizeof(struct gsm_mncc)); 
    29412833        modify.callref = trans->callref; 
    2942         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); 
     2834        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); 
    29432835        /* bearer capability */ 
    29442836        if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { 
     
    29822874        memset(&modify, 0, sizeof(struct gsm_mncc)); 
    29832875        modify.callref = trans->callref; 
    2984         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); 
     2876        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); 
    29852877        /* bearer capability */ 
    29862878        if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { 
     
    30222914        memset(&modify, 0, sizeof(struct gsm_mncc)); 
    30232915        modify.callref = trans->callref; 
    3024         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, GSM48_IE_CAUSE); 
     2916        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, GSM48_IE_CAUSE); 
    30252917        /* bearer capability */ 
    30262918        if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { 
     
    30822974        memset(&notify, 0, sizeof(struct gsm_mncc)); 
    30832975        notify.callref = trans->callref; 
    3084 //      tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len); 
     2976//      tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len); 
    30852977        if (payload_len >= 1) 
    30862978                decode_notify(&notify.notify, gh->data); 
     
    31163008        memset(&user, 0, sizeof(struct gsm_mncc)); 
    31173009        user.callref = trans->callref; 
    3118         tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, GSM48_IE_USER_USER, 0); 
     3010        tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_USER_USER, 0); 
    31193011        /* user-user */ 
    31203012        if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) {