anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019, Infosys Ltd. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | |
| 18 | #ifndef __UE_S11_H_ |
| 19 | #define __UE_S11_H_ |
| 20 | |
| 21 | #include <stdint.h> |
| 22 | #include "log.h" |
| 23 | #include "s11_structs.h" |
| 24 | |
| 25 | /*No of threads handling S11 GTPv2 messages coming in*/ |
| 26 | #define S11_THREADPOOL_SIZE 5 |
| 27 | |
| 28 | #define S11_GTPV2C_BUF_LEN 4096 |
| 29 | |
| 30 | /*GTPv2c message types*/ |
| 31 | #define S11_GTP_CREATE_SESSION_REQ 32 |
| 32 | #define S11_GTP_CREATE_SESSION_RESP 33 |
| 33 | #define S11_GTP_MODIFY_BEARER_RESP 35 |
| 34 | #define S11_GTP_DELETE_SESSION_RESP 37 |
| 35 | #define S11_GTP_RELEASE_BEARER_REQ 170 |
| 36 | #define S11_GTP_RELEASE_BEARER_RESP 171 |
| 37 | #define S11_GTP_DDN 176 |
| 38 | |
| 39 | /*GTPv2c IE message types*/ |
| 40 | #define S11_IE_CAUSE 2 |
| 41 | #define S11_IE_FTEID_C 87 |
| 42 | #define S11_IE_PAA 79 |
| 43 | #define S11_IE_APN_RESTRICTION 127 |
| 44 | #define S11_IE_BEARER_CTX 93 |
| 45 | #define S11_IE_EPS_BEARER_ID 73 |
| 46 | |
| 47 | int |
| 48 | init_s11(); |
| 49 | |
| 50 | void |
| 51 | handle_s11_message(void *message); |
| 52 | |
| 53 | int |
| 54 | init_s11(); |
| 55 | |
| 56 | void |
| 57 | handle_s11_message(void *message); |
| 58 | |
| 59 | int |
| 60 | s11_transation(char * buf, unsigned int len); |
| 61 | |
| 62 | void* create_session_handler(void *); |
| 63 | void* modify_bearer_handler(void *); |
| 64 | void* release_bearer_handler(void *); |
| 65 | void* delete_session_handler(void *); |
| 66 | void* ddn_ack_handler(void *); |
| 67 | /*int s11_CS_resp_handler(char *message); |
| 68 | int s11_MB_resp_handler(char *message); |
| 69 | int s11_DS_resp_handler(char *message); |
| 70 | int s11_RB_resp_handler(char *message); |
| 71 | int s11_DDN_handler(char *message); |
| 72 | */ |
| 73 | |
| 74 | |
| 75 | void |
| 76 | bswap8_array(uint8_t *src, uint8_t *dest, uint32_t len); |
| 77 | |
| 78 | int parse_gtpv2c_IEs(char *msg, int len, struct s11_proto_IE *proto_ies); |
| 79 | |
| 80 | #endif /*S11_H*/ |