EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
evecollector.cpp File Reference
#include "../common/logsys.h"
#include "../common/PyRep.h"
#include "EVECollectDisp.h"
Include dependency graph for evecollector.cpp:

Go to the source code of this file.

Functions

int EVE_NIDS_main (EVECollectDispatcher *disp, int argc, char *argv[])
 
int main (int argc, char *argv[])
 

Function Documentation

int EVE_NIDS_main ( EVECollectDispatcher disp,
int  argc,
char *  argv[] 
)

Definition at line 196 of file EVEnids.cpp.

References strdup, and tcp_callback().

Referenced by main().

196  {
197  if(disp == NULL) {
198  fprintf(stderr,"NULL dispatcher provided to NIDS, not running\n",nids_errbuf);
199  return(1);
200  }
201  CollectDispatcher = disp;
202 
203  // here we can alter libnids params, for instance:
204  // nids_params.n_hosts=256;
205  if(argc == 2)
206  nids_params.filename = strdup(argv[1]);
207  if(argc == 3) //hack
208  nids_params.device = strdup(argv[2]);
209  if (!nids_init ()) {
210  fprintf(stderr,"%s\n",nids_errbuf);
211  return(1);
212  }
213 
214  nids_register_tcp ((void *) tcp_callback);
215  printf("Starting NIDS loop...\n");
216  nids_run ();
217  return(0);
218 }
static EVECollectDispatcher * CollectDispatcher
Definition: EVEnids.cpp:82
#define strdup
Definition: eve-compat.h:258
void tcp_callback(struct tcp_stream *a_tcp, void **this_time_not_needed)
Definition: EVEnids.cpp:88

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 32 of file evecollector.cpp.

References _log, EVE_NIDS_main(), load_log_settings(), PyLookupResolver::LoadIntFile(), PyLookupResolver::LoadStringFile(), and EVECollectDispatcher::lookResolver.

Referenced by Sentry::EncodeDestiny(), CustomsSE::EncodeDestiny(), Concord::EncodeDestiny(), NPC::EncodeDestiny(), DroneSE::EncodeDestiny(), AsteroidSE::EncodeDestiny(), StructureSE::EncodeDestiny(), AnomalySE::EncodeDestiny(), WormholeSE::EncodeDestiny(), StationSE::EncodeDestiny(), SystemEntity::EncodeDestiny(), StaticSystemEntity::EncodeDestiny(), ShipSE::EncodeDestiny(), ItemSystemEntity::EncodeDestiny(), FieldSE::EncodeDestiny(), ObjectSystemEntity::EncodeDestiny(), DynamicSystemEntity::EncodeDestiny(), ClassDecodeGenerator::ProcessElementDef(), ClassHeaderGenerator::ProcessElementDef(), and ClassEncodeGenerator::ProcessElementDef().

32  {
33 
34  if(!load_log_settings("log.ini"))
35  _log(COLLECT__MESSAGE, "Warning: Unable to read %s", "log.ini");
36  else
37  _log(COLLECT__MESSAGE, "Log settings loaded from %s", "log.ini");
38 
39  if(!PyRepString::LoadStringFile("strings.txt"))
40  _log(COLLECT__ERROR, "Unable to open ./strings.txt, I need it to decode string table elements!");
41 
42  EVECollectDispatcher dispatch;
43  dispatch.lookResolver.LoadIntFile("intres.txt");
44  dispatch.lookResolver.LoadStringFile("strres.txt");
45 
46  return(EVE_NIDS_main(&dispatch, argc, argv));
47 }
#define _log(type, fmt,...)
Definition: logsys.h:124
bool load_log_settings(const char *filename)
Definition: logsys.cpp:168
int EVE_NIDS_main(EVECollectDispatcher *disp, int argc, char *argv[])
Definition: EVEnids.cpp:196
PyLookupResolver lookResolver
bool LoadIntFile(const char *file)
bool LoadStringFile(const char *file)

Here is the call graph for this function:

Here is the caller graph for this function: