|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*!
- * \file core.h
- *
- * \author Christos Choutouridis AEM:8997 <cchoutou@ece.auth.gr>
- */
-
- #ifndef __core_h__
- #define __core_h__
-
- #include <netinet/in.h>
-
- #include "msg_impl.h"
-
- extern msgList_t msgList;
-
- devAEM_t addr2devAEM (in_addr_t in_addr);
- in_addr_t devAEM2addr (devAEM_t dev);
- devAEM_t ip2AEM (devIP_t* ip);
- devIP_t AEM2ip (devAEM_t dev);
-
- void cMsg_make (cMsg_t* msg);
- size_t cMsg_serialize (cMsg_t* msg, char_t* buffer);
- status_t cMsg_parse (cMsg_t* cMsg, char_t* rawMsg, size_t size);
- uint32_t cMsg_getFrom (cMsg_t* cMsg);
- uint32_t cMsg_getTo (cMsg_t* cMsg);
- uint64_t cMsg_getTs (cMsg_t* cMsg);
- char_t* cMsg_getText (cMsg_t* cMsg);
- bool_t cMsg_equal (cMsg_t* m1, cMsg_t* m2);
-
- void msg_init (msg_t* msg);
-
- dIter_t devList_getIter (devAEM_t dev);
-
- mIter_t msgList_preInc (mIter_t* it);
- mIter_t msgList_preDec (mIter_t* it);
- status_t msgList_init (msgList_t* msgList);
- mIter_t msgList_begin (msgList_t* this);
- mIter_t msgList_last (msgList_t* this);
- size_t msgList_size (msgList_t* this);
- mIter_t msgList_find (msgList_t* this, msg_t* msg);
- mIter_t msgList_add (msgList_t* this, msg_t* msg);
- void msgList_acquire ();
- void msgList_release ();
-
- status_t stats_init (stats_t* s);
- void statsUpdateCreate (msg_t* msg);
- void statsUpdateIn (msg_t* msg, bool_t dup);
- void statsUpdateOut (msg_t* msg, devAEM_t dev);
- status_t statsPrint (stats_t* stats);
-
- status_t log_init(void);
- void log_msg_in (msg_t* msg);
- void log_msg_out (msg_t* msg, devAEM_t dev);
- void log_msg_new (msg_t* msg);
- void log_debug (const char *fmt, ...);
- void log_error (const char *fmt, ...);
-
-
- #endif /* __core_h__ */
|