EpcTools
An event based multi-threaded C++ development framework.
efdjson.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2017 Sprint
3 * Copyright (c) 2019 Sprint
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 
18 #ifndef __EFDJSON_H
19 #define __EFDJSON_H
20 
21 #include <freeDiameter/freeDiameter-host.h>
22 #include "freeDiameter/libfdproto.h"
23 #include "freeDiameter/libfdcore.h"
24 
27 
28 #ifdef __cplusplus
29 void fdJsonGetJSON( msg_or_avp *ref, std::string &json, void (*errfunc)(const char *) );
39 bool fdJsonGetValueOfMember( std::string json, std::string member, std::string &value );
44 bool fdJsonGetApnValueFromSubData( std::string json, std::string &apn );
45 extern "C" {
46 #endif
47 
53 int fdJsonAddAvps( const char *json, msg_or_avp *msg, void (*errfunc)(const char *) );
58 const char *fdJsonGetJSON( msg_or_avp *msg, void (*errfunc)(const char *) );
59 
61 #define FDJSON_SUCCESS 0
62 #define FDJSON_JSON_PARSING_ERROR 1
63 #define FDJSON_EXCEPTION 2
64 
66 #ifdef __cplusplus
67 };
68 #endif
69 
70 #endif /* #define __EFDJSON_H */
fdJsonAddAvps
int fdJsonAddAvps(const char *json, msg_or_avp *msg, void(*errfunc)(const char *))
Adds the AVP from the JSON string to a freeDiameter message or grouped AVP.
Definition: efdjson.cpp:679
fdJsonGetApnValueFromSubData
bool fdJsonGetApnValueFromSubData(std::string json, std::string &apn)
Definition: efdjson.cpp:1117
fdJsonGetValueOfMember
bool fdJsonGetValueOfMember(std::string json, std::string member, std::string &value)
Definition: efdjson.cpp:1059
fdJsonGetJSON
const char * fdJsonGetJSON(msg_or_avp *msg, void(*errfunc)(const char *))
Converts the AVP's from a freeDiameter message or grouped AVP to a JSON string.
Definition: efdjson.cpp:1050