#include "bouncer.h" //using namespace xapp; std::unique_ptr xfw; void display_json(web::json::value const & jvalue){ std::cout<<"\ndisplaying REST Notification\n"; std::wcout << jvalue.serialize().c_str() << std::endl; } void indication_callback( Message& mbuf, int mtype, int subid, int len, Msg_component payload, void* data ) { std::cout << "[INFO] indication Callback got a message, type=" << mtype << ", length=" << len << std::endl; //std::string json ((char *)payload.get(), len); // RMR payload might not have a nil terminanted char E2AP_PDU_t* e2pdu = (E2AP_PDU_t*)calloc(1, sizeof(E2AP_PDU)); asn_transfer_syntax syntax; syntax = ATS_ALIGNED_BASIC_PER; auto rval = asn_decode(nullptr, syntax, &asn_DEF_E2AP_PDU, (void**)&e2pdu, (char *)payload.get(), len); if(rval.code == RC_OK) { std::cout << "[INFO] E2AP indication decode successfull rval.code = "< task) { try { answer = task.get(); display_json(answer); } catch (web::http::http_exception const & e) { std::wcout << e.what() << std::endl; } }) .wait(); request.reply(web::http::status_codes::OK, answer); } extern int main( int argc, char** argv ) { int nthreads = 1; char* port = (char *) "4560"; xfw = std::unique_ptr( new Xapp( port, true ) ); xfw->Add_msg_cb( RIC_INDICATION , indication_callback, NULL ); Bouncer B; while(B.gnb_list.size() ==0){ B.set_gnb(); } std::cout << "[INFO] size of gnb list is "<Run( nthreads ); }