EpcTools
An event based multi-threaded C++ development framework.
|
Go to the documentation of this file.
144 #include <arpa/inet.h>
152 #include "freeDiameter/freeDiameter-host.h"
153 #include "freeDiameter/libfdcore.h"
154 #include "freeDiameter/libfdproto.h"
185 FDBuffer(
size_t size) { msize = size; mbuf =
new T[msize]; }
205 FDEngine(
const char *cfgfile = NULL );
210 FDEngine(
const std::string &cfgfile );
223 Void
uninit( Bool wait =
true );
269 struct dict_object *
getEntry()
const {
return m_de; }
282 FDDictionaryEntry(
const Void *what,
enum dict_object_type type, Int criteria,
struct dictionary *dict = NULL );
289 Void
init(
const Void *what,
enum dict_object_type type, Int criteria,
struct dictionary *dict = NULL );
293 Void
init(
struct dict_object *de,
struct dictionary *dict = NULL );
300 struct dictionary *m_dict;
301 struct dict_object *m_de;
320 const char *
getName()
const {
return m_data.application_name; }
323 application_id_t
getId()
const {
return m_data.application_id; }
328 dict_application_data m_data;
355 const char *
getName() {
return m_data.vendor_name; }
358 vendor_id_t
getId() {
return m_data.vendor_id; }
363 dict_vendor_data m_data;
414 FDDictionaryEntryAVP(
const char *name, Bool allVendors =
false,
struct dictionary *dict = NULL );
432 const char *
getName()
const {
return m_basedata.avp_name; }
438 avp_code_t
getAvpCode()
const {
return m_basedata.avp_code; }
447 vendor_id_t m_vendorid;
449 struct dict_avp_data m_basedata;
450 struct dict_object *m_derivedtype;
451 struct dict_type_data m_derivedtypedata;
481 Bool
isRequest()
const {
return ( m_data.cmd_flag_val & CMD_FLAG_REQUEST ) ? true :
false; }
484 Bool
isAnswer()
const {
return ( m_data.cmd_flag_val & CMD_FLAG_REQUEST ) ? false :
true; }
491 const char *
getName() {
return m_data.cmd_name; }
494 struct dict_cmd_data m_data;
655 Bool
get( int32_t &v ) {
if ( m_avphdr == NULL )
return false; v = m_avphdr->avp_value->i32;
return true; }
659 Bool
get( uint32_t &v ) {
if ( m_avphdr == NULL )
return false; v = m_avphdr->avp_value->u32;
return true; }
663 Bool
get( uint64_t &v ) {
if ( m_avphdr == NULL )
return false; v = m_avphdr->avp_value->u64;
return true; }
667 Bool
get(
float &v ) {
if ( m_avphdr == NULL )
return false; v = m_avphdr->avp_value->f32;
return true; }
671 Bool
get(
double &v ) {
if ( m_avphdr == NULL )
return false; v = m_avphdr->avp_value->f64;
return true; }
675 Bool
get( int64_t &v );
679 Bool
get( std::string &v );
684 Bool
get(
char *data,
size_t &len );
689 Bool
get( uint8_t *data,
size_t &len );
704 FDAvp &
set( int32_t v ) { m_value.i32 = v; assignValue();
return *
this; }
709 FDAvp &
set( uint32_t v ) { m_value.u32 = v; assignValue();
return *
this; }
714 FDAvp &
set( uint64_t v ) { m_value.u64 = v; assignValue();
return *
this; }
719 FDAvp &
set(
float v ) { m_value.f32 = v; assignValue();
return *
this; }
724 FDAvp &
set(
double v ) { m_value.f64 = v; assignValue();
return *
this; }
735 FDAvp &
set(
const uint8_t *v,
size_t len ) { m_value.os.data = (uint8_t*)v; m_value.os.len = len; assignValue();
return *
this; }
740 FDAvp &
set(
const std::string &v ) {
return set( v.c_str(), v.size() ); }
751 FDAvp &
set(
const char *v,
size_t len );
812 Bool
getJson( std::string &json );
825 Void
addTo( msg_or_avp *reference );
835 struct avp_hdr *m_avphdr;
837 union avp_value m_value;
1049 Bool
getJson( std::string &json );
1098 struct dict_cmd_data m_basedata;
1170 static Void anscb( Void * data,
struct msg ** pmsg );
1172 Bool m_preserve_answer;
1219 #define FDISREQUEST(hdr) ((hdr->msg_flags & CMD_FLAG_REQUEST) == CMD_FLAG_REQUEST)
1220 #define FDISANSWER(hdr) ((hdr->msg_flags & CMD_FLAG_REQUEST) != CMD_FLAG_REQUEST)
1251 static Int commandcb(
struct msg **m,
struct avp *avp,
struct session *session, Void *data,
enum disp_action *action );
1254 std::list<FDCommandRequest*> m_cmds;
1280 struct session *m_session;
1329 FDPeer( DiamId_t diamid, uint16_t port = 3868 );
1333 FDPeer(
const std::string &diamid, uint16_t port = 3868 );
1383 static Void peercb(
struct peer_info *pi, Void *data );
1389 struct peer_hdr *m_peer;
1464 Bool
setResolved( Bool resolved =
true ) {
return m_resolved = resolved; }
1503 : m_vndid( k.m_vndid ),
1504 m_avpcode( k.m_avpcode )
1519 m_vndid < rval.m_vndid ?
True :
1520 m_vndid > rval.m_vndid ?
False : m_avpcode < rval.m_avpcode;
1529 vendor_id_t
setVendor( vendor_id_t v ) {
return m_vndid = v; }
1540 vendor_id_t m_vndid;
1541 avp_code_t m_avpcode;
1593 Bool
exists( Bool skipResolve =
false );
1601 Bool
getJson( std::string &json );
1609 msg_or_avp *m_reference;
1610 std::map<FDExtractorKey,FDExtractorBase*> m_entries;
1655 std::list<FDExtractor*> &
getList();
1661 std::list<FDExtractor*> m_list;
1697 Bool
get( int32_t &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1701 Bool
get( uint32_t &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1705 Bool
get( uint64_t &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1709 Bool
get(
float &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1713 Bool
get(
double &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1717 Bool
get( int64_t &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1721 Bool
get( std::string &v ) {
if ( !
exists() )
return false;
return m_avp.
get( v ); }
1726 Bool
get(
char *data,
size_t &len ) {
if ( !
exists() )
return false;
return m_avp.
get( data, len ); }
1731 Bool
get( uint8_t *data,
size_t &len ) {
if ( !
exists() )
return false;
return m_avp.
get( data, len ); }
1735 Bool
get( sSS &ss ) {
if ( !
exists() )
return false;
return m_avp.
get( ss ); }
1748 Bool
getJson( std::string &json );
1772 std::list<FDExtractorAvp*> &
getList();
1785 std::list<FDExtractorAvp*> m_list;
1804 virtual Void
process(
enum fd_hook_type type,
struct msg * msg,
struct peer_hdr * peer,
1805 Void * other,
struct fd_hook_permsgdata *pmd) = 0;
1821 static Void hook_cb(
enum fd_hook_type type,
struct msg * msg,
struct peer_hdr * peer,
1822 Void * other,
struct fd_hook_permsgdata *pmd, Void * regdata);
1825 struct fd_hook_hdl *m_hdl;
1839 static Void
splitDiameterFQDN( std::string &fqdn, std::string &host, std::string &realm );
1852 static size_t str2tbcd(
const char *src,
size_t srclen, uint8_t *dst,
size_t dstlen );
1858 static size_t str2tbcd(
const char *src, uint8_t *dst,
size_t dstlen );
1864 static size_t str2tbcd(
const std::string &src, uint8_t *dst,
size_t dstlen );
1872 static size_t tbcd2str( uint8_t *src,
size_t srclen,
char *dst,
size_t dstlen );
1878 static size_t tbcd2str( uint8_t *src,
size_t srclen, std::string &dst );
1881 #endif // #define __EFD_H
FDMessage & addJson(const char *json)
Adds the AVP's represented in the JSON string.
Definition: efd.cpp:1357
FDAvp & add(FDDictionaryEntryAVP &de, uint32_t v)
Adds an uint32_t AVP to this grouped AVP.
Definition: efd.h:554
Connection established.
Definition: efd.h:1295
FDAvp getChild(Bool &found)
Returns the first child AVP of this grouped AVP.
Definition: efd.cpp:946
FDMessageRequest(FDDictionaryEntryCommand *cde)
Class constructor. Constructs a request to be sent.
Definition: efd.cpp:1406
Bool get(int32_t &v)
Retrieves an int32_t AVP value. Returns True if the value is successfully retrieved.
Definition: efd.h:655
~FDMessageAnswer()
Class destructor.
Definition: efd.cpp:1373
uint16_t getPort()
Retrieves the IP port for this peer.
Definition: efd.h:1345
FDAvp & add(FDDictionaryEntryAVP &de, float v)
Adds a float AVP to this grouped AVP.
Definition: efd.h:566
const EString & getConfigFile()
Retrieves the configuration file name..
Definition: efd.h:229
FDDictionaryEntryAVP(const char *name, Bool allVendors=false, struct dictionary *dict=NULL)
Class constructor.
Definition: efd.cpp:361
union avp_value * getAvpValue()
Returns the underlying freeDiameter AVP value object.
Definition: efd.h:773
FDAvp & operator=(const std::string &v)
Assigns a string value to this AVP.
Definition: efd.h:645
FDAvp & add(FDDictionaryEntryAVP &de, const std::string &v)
Adds a string to this grouped AVP.
Definition: efd.h:584
const EString & setConfigFile(const char *cf)
Sets the configuration file.
Definition: efd.h:233
~FDMessage()
Class destructor.
Definition: efd.cpp:1207
Bool get(FDDictionaryEntryAVP &de, int64_t &v)
Retrieves the int64_t AVP value associated with specified dictionary entry.
Definition: efd.h:955
FDAvp & addJson(const std::string &json)
Adds the AVP's represented in a JSON string.
Definition: efd.h:808
Bool get(FDDictionaryEntryAVP &de, float &v)
Retrieves the float AVP value associated with specified dictionary entry.
Definition: efd.h:973
~FDAvp()
Class destructor.
Definition: efd.cpp:563
A dictionary entry object associated with a vendor.
Definition: efd.h:334
diameter URI
Definition: efd.h:398
FDMessage & add(FDDictionaryEntryAVP &de, int32_t v)
Adds an int32_t value to this message.
Definition: efd.h:859
FDDictionaryEntryCommand(const char *name, struct dictionary *dict=NULL)
Class constructor.
Definition: efd.cpp:472
octet string
Definition: efd.h:374
FDPeer * getOpenPeer()
Retrieves the first peer that is an open state.
Definition: efd.cpp:1844
static Void splitDiameterFQDN(std::string &fqdn, std::string &host, std::string &realm)
Splits a fully qualified domain name into host and realm.
Definition: efd.cpp:2228
T * get()
Definition: efd.h:187
FDPeer & setDiameterId(DiamId_t diamid)
Assigns the Diameter ID for this peer object.
Definition: efd.h:1341
UTF-8 string (derived from octet string)
Definition: efd.h:394
Various Diameter utility functions.
Definition: efd.h:1832
Void setMsgDelete(Bool v)
Sets value indicating if the freeDiameter message object is to be deleted when this object is destroy...
Definition: efd.h:1089
FDAvp & set(uint32_t v)
Assigns an uint32_t value to this AVP.
Definition: efd.h:709
FDException(const std::string &m)
Class constructor.
Definition: efd.h:175
FDMessage & sendAnswer()
Sends an answer message;.
Definition: efd.cpp:1288
Class for manipulating date and time of day values.
Definition: etime.h:199
FDApplication & registerHandler(FDCommandRequest &cmd)
Registers a message handler for a request command.
Definition: efd.cpp:1505
ETimer m_timer
Definition: efd.h:1167
Void dump()
Prints the AVP contents of this message.
Definition: efd.cpp:1255
Received a CER from this same peer on an incoming connection (other peer object), while we were waiti...
Definition: efd.h:1303
FDAvp & set(const char *v)
Assigns a string value to this AVP.
Definition: efd.h:729
The connection is being shutdown (DPR/DPA in progress).
Definition: efd.h:1299
const char * getName()
Returns the command name.
Definition: efd.h:491
virtual ~FDDictionaryEntry()
Class destructor.
Definition: efd.cpp:272
Bool isRequest()
Indicates if this command is a request (based on the dictionary entry).
Definition: efd.h:1211
A dictionary entry object associated with a command message.
Definition: efd.h:460
Bool get(FDDictionaryEntryAVP &de, std::string &v)
Retrieves the string AVP value associated with specified dictionary entry.
Definition: efd.h:985
const EString & getDestinationIp() const
Retrieves the peer's IP address.
Definition: efd.h:1368
64-bit unsigned integer
Definition: efd.h:382
#define True
True.
Definition: ebase.h:25
const char * getName() const
Returns the AVP name.
Definition: efd.h:432
Bool get(FDDictionaryEntryAVP &de, uint8_t *v, size_t &len)
Retrieves the octet string AVP value associated with specified dictionary entry.
Definition: efd.h:999
32-bit integer
Definition: efd.h:376
FDAvp & set(float v)
Assigns a float value to this AVP.
Definition: efd.h:719
represents an AVP extractor
Definition: efd.h:1419
Void unregisterHook()
Unregisters the hook.
Definition: efd.cpp:2205
FDMessageAnswer(FDMessageRequest *req, struct msg *pmsg)
Class constructor. Constructs the received answer message.
Definition: efd.cpp:1383
Bool isAnswer()
Indicates if this message is an answer.
Definition: efd.h:1026
grouped AVP
Definition: efd.h:388
Bool getJson(std::string &json)
Retrieves the JSON string representing the AVP values for this AVP.
Definition: efd.cpp:1094
FDAvp & operator=(uint64_t v)
Assigns an uint64_t value to this AVP.
Definition: efd.h:625
Connection has been re-established, waiting for 3 DWR/DWA exchanges before putting back to service.
Definition: efd.h:1311
FDAvp & add(FDDictionaryEntryAVP &de, int32_t v)
Adds an int32_t AVP to this grouped AVP.
Definition: efd.h:542
FDMessage & sendRequest(Void(*anscb)(Void *, struct msg **), FDMessageRequest &req)
Sends a request message.
Definition: efd.cpp:1273
struct dictionary * getDictionary() const
Returns the freeDiameter dictionary structure pointer.
Definition: efd.h:266
struct msg * getMsg()
Retrieves the freeDiameter message pointer.
Definition: efd.h:1030
32-bit unsigned integer
Definition: efd.h:380
TLS Handshake and validation are in progress in open state – we use it only for debug purpose,...
Definition: efd.h:1307
Bool get(FDDictionaryEntryAVP &de, double &v)
Retrieves the double AVP value associated with specified dictionary entry.
Definition: efd.h:979
FDPeerState
Peer state enumerations.
Definition: efd.h:1288
Macros for various standard C library functions and standard includes.
virtual Void process(enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer, Void *other, struct fd_hook_permsgdata *pmd)=0
Method that is called to process a freeDiameter hook callback.
Void addSessionId(FDMessage &msg, FDDictionaryEntryAVP &deSessionId)
Adds the Session-Id to a message.
Definition: efd.cpp:1613
FDAvp & add(FDDictionaryEntryAVP &de, uint64_t v)
Adds an uint64_t AVP to this grouped AVP.
Definition: efd.h:560
Bool get(uint64_t &v)
Retrieves an uint64_t AVP value. Returns True if the value is successfully retrieved.
Definition: efd.h:663
FDAvp & set(uint64_t v)
Assigns an uint64_t value to this AVP.
Definition: efd.h:714
FDAvp & operator=(double v)
Assigns a double value to this AVP.
Definition: efd.h:635
Represents a command, a request or answer, that will be registered with freeDiameter.
Definition: efd.h:1176
FDAvp(FDDictionaryEntryAVP &de, Bool dedel=false)
Class constructor.
Definition: efd.cpp:531
~FDBuffer()
Definition: efd.h:186
A dictionary entry object associated with an AVP.
Definition: efd.h:406
FDAvp & operator=(uint32_t v)
Assigns an uint32_t value to this AVP.
Definition: efd.h:620
Connection established, CER sent, waiting for CEA.
Definition: efd.h:1305
FDDictionaryEntryApplication(const char *name, struct dictionary *dict=NULL)
Class constructor.
Definition: efd.cpp:279
FDAvp & add(FDAvp &avp)
Adds an AVP to this grouped AVP.
Definition: efd.cpp:575
struct dict_object * getEntry() const
Returns the freeDiameter dictionary entry structure pointer.
Definition: efd.h:269
Bool isAnswer()
Indicates if this command is an answer.
Definition: efd.h:1188
FDAvp & add(FDDictionaryEntryAVP &de, const uint8_t *v, size_t len)
Adds an octet string AVP to this grouped AVP.
Definition: efd.h:598
FDApplication()
Default class constructor.
Definition: efd.h:1244
Bool get(FDDictionaryEntryAVP &de, ETime &v)
Retrieves the time AVP value associated with specified dictionary entry.
Definition: efd.h:1005
No connection established, will re-attempt after TcTimer.
Definition: efd.h:1297
FDDictionaryEntryVendor(const char *name, struct dictionary *dict=NULL)
Class constructor.
Definition: efd.cpp:308
virtual Bool isRequest()=0
Indicates if this command is a request (based on the dictionary entry).
FDDictionaryEntryAVP & getDictionaryEntry()
Retrieves the dictionary entry associated with this FDAvp object.
Definition: efd.h:819
Bool getJson(std::string &json)
Retrieves a JSON string with all of the AVP's represented in it.
Definition: efd.cpp:1364
After DPA is sent or received, give a short delay for messages in the pipe to be received.
Definition: efd.h:1315
FDAvp & add(FDDictionaryEntryAVP &de, const char *v)
Adds a string AVP to this grouped AVP.
Definition: efd.h:578
Bool get(double &v)
Retrieves a double AVP value.
Definition: efd.h:671
represents an AVP list extractor
Definition: efd.h:1421
Bool isAnswer() const
Returns True of the command is an answer.
Definition: efd.h:484
Void waitForShutdown()
Waits for freeDiameter to shut down.
Definition: efd.cpp:196
Bool isValid()
Indicates if this AVP object is valid.
Definition: efd.h:535
FDAvp & add(FDDictionaryEntryAVP &de, double v)
Adds a double AVP to this grouped AVP.
Definition: efd.h:572
FDAvp findAVP(FDDictionaryEntryAVP &de)
Retrieves the AVP object specified by the dictionary entry from this message.
Definition: efd.cpp:1215
static size_t tbcd2str(uint8_t *src, size_t srclen, char *dst, size_t dstlen)
Converts a TBCD value to a series of digits.
Definition: efd.cpp:2309
Invalid or undefined state.
Definition: efd.h:1291
Void advertiseSupport(FDDictionaryEntryApplication &app, Int auth=0, Int acct=0)
Configures a Diameter application to be advertised in the CER/CEA.
Definition: efd.cpp:201
Implements a stopwatch style timer.
Definition: etimer.h:26
FDAvp & set(int32_t v)
Assigns an int32_t value to this AVP.
Definition: efd.h:704
FDMessage & add(FDDictionaryEntryAVP &de, uint64_t v)
Adds an uint64_t value to this message.
Definition: efd.h:877
Provides class for manipulating time of day values.
represents an extractor (grouped AVP)
Definition: efd.h:1423
FDMessage & add(FDDictionaryEntryAVP &de, const ETime &v)
Adds a time value to this message.
Definition: efd.h:921
Represents a Diameter peer.
Definition: efd.h:1321
32-bit floating point
Definition: efd.h:384
The PSM thread is not running anymore; it must be re-started or peer should be deleted.
Definition: efd.h:1317
#define False
False.
Definition: ebase.h:27
Void addTo(msg_or_avp *reference)
Adds the contents of the message or avp to this AVP object.
Definition: efd.cpp:974
FDPeer & setPort(uint16_t v)
Assigns the IP port for this peer.
Definition: efd.h:1349
Void init(const Void *what, enum dict_object_type type, Int criteria, struct dictionary *dict=NULL)
initializes an object created with the default constructor.
Definition: efd.cpp:244
Exception base class used within the freeDiameter wrapper classes.
Definition: efd.h:163
FDException(const char *m)
Class constructor.
Definition: efd.h:170
avp_code_t getAvpCode() const
Returns the AVP code/ID.
Definition: efd.h:438
FDMessage & add(FDDictionaryEntryAVP &de, uint32_t v)
Adds an uint32_t value to this message.
Definition: efd.h:871
FDPeerList()
Class constructor.
Definition: efd.cpp:1817
Registers, unregisters and process freeDiameter hooks. See "MONITORING" in libfdcore....
Definition: efd.h:1792
static Void splitDiameterFQDN(const char *fqdn, std::string &host, std::string &realm)
Splits a fully qualified domain name into host and realm.
Definition: efd.h:1844
time value
Definition: efd.h:392
Represents a Diameter answer message (in rsponse to a request).
Definition: efd.h:1102
FDHook()
Class constructor.
Definition: efd.cpp:2192
Bool isValid()
Returns true if the dictionary entry is valid.
Definition: efd.h:272
vendor_id_t getId()
Returns the vendor ID associated with the vendor.
Definition: efd.h:358
A class wrapper around a freeDiameter AVP object.
Definition: efd.h:507
FDBuffer(size_t size)
Definition: efd.h:185
FDAvp & add(FDDictionaryEntryAVP &de, int64_t v)
Adds an int64_t AVP to this grouped AVP.
Definition: efd.h:548
const char * getName() const
Returns the name of the application.
Definition: efd.h:320
Bool registerHook(UInt hookmask)
Registers the hook for the specified events.
Definition: efd.cpp:2198
FDDictionaryEntryCommand & getDictionaryEntry()
The dictionary entry associated with the command.
Definition: efd.h:1181
DiameterDataType
The Diameter AVP data types.
Definition: efd.h:369
vendor_id_t getVendorId() const
Returns the AVP vendor ID.
Definition: efd.h:435
Defines various utility functions.
~FDApplication()
Class destructor.
Definition: efd.cpp:1501
FDAvp & addJson(const char *json)
Adds the AVP's represented in a JSON string.
Definition: efd.cpp:1087
Bool isOpen()
Indicates if the connection to the peer is open.
Definition: efd.h:1376
FDMessage & add(FDAvp &avp)
Adds the contents of "avp" to this message.
Definition: efd.h:853
~FDSession()
Class destructor.
Definition: efd.cpp:1601
FDCommandRequest(FDDictionaryEntryCommand &de)
Class constructor.
Definition: efd.cpp:1488
eFDExtractorType
Defines the types of extractors.
Definition: efd.h:1416
The peer has been just been created, PSM thread not started yet.
Definition: efd.h:1293
unknown/undefined
Definition: efd.h:372
static size_t str2tbcd(const char *src, size_t srclen, uint8_t *dst, size_t dstlen)
Converts a series of digits to telephony binary coded decimal.
Definition: efd.cpp:2253
FDDictionaryEntryCommand * getCommand()
Definition: efd.h:847
FDDictionaryEntryApplication * setDictionaryEntry(FDDictionaryEntryApplication *de)
Retrieves the dictionary entry for the application.
Definition: efd.h:1247
Represents a Diameter request message.
Definition: efd.h:1129
A dictionary entry object associated with an application.
Definition: efd.h:308
Void addOrigin()
Adds the Origin-Host and Origin-Realm to this message.
Definition: efd.cpp:1303
FDAvp & setAvp(struct avp *a)
Sets the freeDiameter AVP object that this object is associated with.
Definition: efd.cpp:1023
Allocates and assigns a Session-Id.
Definition: efd.h:1261
FDAvp & set(const uint8_t *v, size_t len)
Assigns an octet string value to this AVP.
Definition: efd.h:735
FDMessage & addJson(const std::string &json)
Adds the AVP's represented in the JSON string.
Definition: efd.h:1045
virtual Int process(FDMessageRequest *req)=0
Method that will process the request.
A list of FDPeer objects.
Definition: efd.h:1393
Bool start()
Starts freeDiameter.
Definition: efd.cpp:169
Bool setPreserveAnswer(Bool preserve)
Sets indication whether to preserve the answer or not.
Definition: efd.h:1161
FDEngine(const char *cfgfile=NULL)
Class constructor.
Definition: efd.cpp:129
FDMessage & add(FDDictionaryEntryAVP &de, const char *v)
Adds a string value to this message.
Definition: efd.h:895
FDSession()
Class constructor.
Definition: efd.cpp:1576
Bool isRequest()
Indicates if this message is a request.
Definition: efd.h:1023
Bool get(uint32_t &v)
Retrieves an uint32_t AVP value. Returns True if the value is successfully retrieved.
Definition: efd.h:659
Attempting to establish transport-level connection.
Definition: efd.h:1301
virtual ~FDMessageRequest()
Definition: efd.cpp:1436
FDAvp & set(double v)
Assigns a double value to this AVP.
Definition: efd.h:724
FDDictionaryEntryApplication & getDictionaryEntry()
The dictionary entry for the application.
Definition: efd.h:1235
Bool getPreserveAnswer()
Sets indication whether to preserve the answer or not.
Definition: efd.h:1164
FDAvp & set(const std::string &v)
Assigns a string value to this AVP.
Definition: efd.h:740
command_code_t getCommandCode()
Returns the command ID.
Definition: efd.h:488
Bool get(FDDictionaryEntryAVP &de, char *v, size_t &len)
Retrieves the octet string AVP value associated with specified dictionary entry.
Definition: efd.h:992
Void uninit(Bool wait=true)
Shuts down freeDiameter.
Definition: efd.cpp:185
Bool init()
Initializes freeDiameter and loads the configuration file.
Definition: efd.cpp:144
Bool get(FDDictionaryEntryAVP &de, int32_t &v)
Retrieves the int32_t AVP value associated with specified dictionary entry.
Definition: efd.h:949
FDMessage & add(FDDictionaryEntryAVP &de, const uint8_t *v, size_t len)
Adds an octet string value to this message.
Definition: efd.h:915
64-bit integer
Definition: efd.h:378
const std::string & getDiameterId()
Retrieves the Diameter ID of the peer.
Definition: efd.h:1337
FDPeerState getState()
Retrieves the peer connection state.
Definition: efd.cpp:1684
FDMessageRequest & send()
Sends the request.
Definition: efd.cpp:1440
~FDEngine()
Class destructor.
Definition: efd.cpp:140
diameter identity (UTF-8 string)
Definition: efd.h:396
const EString & setDestinationIp(const std::string &ip)
Assigns the peer's IP address.
Definition: efd.h:1365
FDAvp & add(FDDictionaryEntryAVP &de, const ETime &v)
Adds a time AVP to this grouped AVP.
Definition: efd.h:604
UInt getHookMask()
Retrieves the hook mask.
Definition: efd.h:1818
String class.
Definition: estring.h:30
const EString & setConfigFile(const std::string &cf)
Sets the configuration file.
Definition: efd.h:237
FDAvp & operator=(int64_t v)
Assigns an int64_t value to this AVP.
Definition: efd.h:615
FDPeer()
Class constructor.
Definition: efd.cpp:1663
Bool get(FDDictionaryEntryAVP &de, uint64_t &v)
Retrieves the uint64_t AVP value associated with specified dictionary entry.
Definition: efd.h:967
struct avp * getAvp()
Returns the underlying freeDiameter AVP object.
Definition: efd.h:770
FDMessage & add(FDDictionaryEntryAVP &de, int64_t v)
Adds an int64_t value to this message.
Definition: efd.h:865
Represents a Diameter application.
Definition: efd.h:1224
A DWR was sent and not answered within TwTime. Failover in progress.
Definition: efd.h:1309
Bool get(FDDictionaryEntryAVP &de, uint32_t &v)
Retrieves the uint32_t AVP value associated with specified dictionary entry.
Definition: efd.h:961
Provides an interface for controlling freeDiameter.
Definition: efd.h:198
After CEA is sent, until a new message is received. Force ordering in this state.
Definition: efd.h:1313
FDMessageAnswer & send()
Sends the answer.
Definition: efd.cpp:1397
const EString & getDestinationRealm() const
Retrieves the distination realm for this peer.
Definition: efd.h:1356
IP address.
Definition: efd.h:390
FDAvp getFirstAVP(Bool &found)
Retrieves the first AVP object from this message.
Definition: efd.cpp:1230
enumerated type
Definition: efd.h:400
const EString & setDestinationIp(const char *ip)
Assigns the peer's IP address.
Definition: efd.h:1361
FDMessage & add(FDDictionaryEntryAVP &de, double v)
Adds a double value to this message.
Definition: efd.h:889
FDDictionaryEntry()
Class constructor.
Definition: efd.cpp:232
Represents a freeDiameter message.
Definition: efd.h:844
virtual Void processAnswer(FDMessageAnswer &ans)
A virtual message that will process the answer message received in response to this request message.
Definition: efd.cpp:1447
A class wrapper around a freeDiameter dictionary entry. This base class is not intended to be directl...
Definition: efd.h:261
FDMessage & add(FDDictionaryEntryAVP &de, float v)
Adds a float value to this message.
Definition: efd.h:883
Void add()
Adds the peer to freeDiameter.
Definition: efd.cpp:1720
const EString & getDestinationHost() const
Retrieves the distination host for this peer.
Definition: efd.h:1353
struct fd_hook_hdl * getHandle()
Retrieves the hook handle.
Definition: efd.h:1814
~FDPeerList()
Class destructor.
Definition: efd.cpp:1821
represents an extractor list (grouped AVP)
Definition: efd.h:1425
FDAvp getNext(Bool &found)
Returns the next AVP from a grouped AVP.
Definition: efd.cpp:921
Encapsulates and extends a std::string object.
FDMessage & add(FDDictionaryEntryAVP &de, const std::string &v)
Adds a string value to this message.
Definition: efd.h:901
Bool get(float &v)
Retrieves a float AVP value.
Definition: efd.h:667
FDMessage & add(FDDictionaryEntryAVP &de, const char *v, size_t len)
Adds an octet string value to this message.
Definition: efd.h:908
DiameterDataType getDataType() const
Returns the data type of the AVP.
Definition: efd.h:441
FDAvp & operator=(float v)
Assigns a float value to this AVP.
Definition: efd.h:630
IP filter rule.
Definition: efd.h:402
FDAvp & operator=(const ETime &v)
Assigns a time value to this AVP.
Definition: efd.h:650
FDAvp & operator=(const char *v)
Assigns a string value to this AVP.
Definition: efd.h:640
application_id_t getId() const
Returns the Diameter application ID of the application.
Definition: efd.h:323
Bool isPeerOpen()
Indicates if the peer is in an open state.
Definition: efd.cpp:1831
FDAvp & operator=(int32_t v)
Assigns an int32_t value to this AVP.
Definition: efd.h:610
const char * getName()
Returns the name of the vendor.
Definition: efd.h:355
Bool isDerived() const
Indicates whether the data type is derived from another or if it is a base data type.
Definition: efd.h:428
Bool isRequest() const
Returns True of the command is a request.
Definition: efd.h:481
FDAvp & add(FDDictionaryEntryAVP &de, const char *v, size_t len)
Adds an octet string AVP to this grouped AVP.
Definition: efd.h:591
Represents a command request.
Definition: efd.h:1202
64-bit floating point
Definition: efd.h:386
Void dump()
Prints the contents of this AVP to the screen.
Definition: efd.cpp:1100
const EString & getSessionId()
Retrieves a string representation of the session ID.
Definition: efd.cpp:1628