#include <unistd.h>#include <getopt.h>#include <cstdarg>#include <sstream>#include <list>#include <set>#include <map>#include <fstream>#include "cst/constants.hh"#include "net/ipaddress.hh"#include "set/interfaces.hh"#include "sys/interfaceinfo.hh"#include "set/gate.hh"#include "utl/log.hh"#include "utl/syslog.hh"Go to the source code of this file.
Namespaces | |
| namespace | olsr |
| namespace | olsr::utl |
| namespace | olsr::utl::internal |
| namespace | std |
Classes | |
| struct | olsr::utl::internal::IfTuple |
| struct | std::less< ::olsr::utl::internal::IfTuple > |
Defines | |
| #define | QOLYESTER_DAEMON_UTL_ARGS_HXX 1 |
| #define | ARG_VERSION 256 |
| #define | ARG_DUMPSTATE 257 |
| #define | ARG_DUMPHELLO 258 |
| #define | ARG_DUMPTC 259 |
| #define | ARG_DUMPMID 260 |
| #define | ARG_DUMPHNA 261 |
| #define | ARG_DUMPALL 262 |
| #define | ARG_ERRORFILE 263 |
| #define | ARG_WARNINGFILE 264 |
| #define | ARG_NOTICEFILE 265 |
| #define | ARG_DUMPFILE 266 |
| #define | ARG_DEBUGFILE 267 |
| #define | ARG_DUMPPROF 268 |
| #define | ARG_NOTABLES 270 |
| #define | ARG_SWSOCK 271 |
| #define | ARG_ALLFILE 272 |
| #define | ARG_DEBUGTRACE 273 |
| #define | ARG_HELLOINTERVAL 274 |
| #define | ARG_REFRESHINTERVAL 275 |
| #define | ARG_TCINTERVAL 276 |
| #define | ARG_MIDINTERVAL 277 |
| #define | ARG_HNAINTERVAL 278 |
| #define | ARG_MIDHOLDTIME 279 |
| #define | ARG_HNAHOLDTIME 280 |
| #define | ARG_NEIGHBHOLDTIME 281 |
| #define | ARG_TOPHOLDTIME 282 |
| #define | ARG_DUPHOLDTIME 283 |
| #define | ARG_MAXJITTERTIME 284 |
| #define | ARG_DUMPINTERVAL 287 |
| #define | ARG_DIRTYPROMISCHACK 288 |
| #define | ARG_QUEUESIZE 289 |
| #define | ARG_HELLOGRACE 290 |
| #define | ARG_HYSTHI 291 |
| #define | ARG_HYSTLO 292 |
| #define | ARG_HYSTSCALING 293 |
| #define | GETNUMBER(Variable, Option) |
| #define | GETFLOAT(Variable, Option) |
| #define | PROC_BUF(Name, Buf) |
| #define | SPB StringPrefixBuf |
| #define | PROC_LOG_PREFIXED(Name) |
| #define | PROC_LOG(Name) |
| #define | SPB StringPrefixBuf |
| #define | PROC_LOG_PREFIXED(Name, Level) |
| #define | PROC_LOG(Name, Level) |
Functions | |
| static std::string | olsr::usage () |
| static std::string | olsr::putversion () |
| static void | olsr::die (const char *format,...) |
| void | olsr::utl::parse_args (int &argc, char **&argv) |
| void | olsr::utl::output_syslog () |
| void | olsr::utl::start_output () |
| void | olsr::utl::stop_output () |
Variables | |
| std::ostream | olsr::dump |
| std::ostream | olsr::dump_prof |
| char | olsr::utl::cerr_buffer [4096] |
| #define ARG_ALLFILE 272 |
Referenced by olsr::utl::parse_args().
| #define ARG_DEBUGFILE 267 |
Referenced by olsr::utl::parse_args().
| #define ARG_DEBUGTRACE 273 |
Referenced by olsr::utl::parse_args().
| #define ARG_DIRTYPROMISCHACK 288 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPALL 262 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPFILE 266 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPHELLO 258 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPHNA 261 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPINTERVAL 287 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPMID 260 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPPROF 268 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPSTATE 257 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUMPTC 259 |
Referenced by olsr::utl::parse_args().
| #define ARG_DUPHOLDTIME 283 |
Referenced by olsr::utl::parse_args().
| #define ARG_ERRORFILE 263 |
Referenced by olsr::utl::parse_args().
| #define ARG_HELLOGRACE 290 |
Referenced by olsr::utl::parse_args().
| #define ARG_HELLOINTERVAL 274 |
Referenced by olsr::utl::parse_args().
| #define ARG_HNAHOLDTIME 280 |
Referenced by olsr::utl::parse_args().
| #define ARG_HNAINTERVAL 278 |
Referenced by olsr::utl::parse_args().
| #define ARG_HYSTHI 291 |
Referenced by olsr::utl::parse_args().
| #define ARG_HYSTLO 292 |
Referenced by olsr::utl::parse_args().
| #define ARG_HYSTSCALING 293 |
Referenced by olsr::utl::parse_args().
| #define ARG_MAXJITTERTIME 284 |
Referenced by olsr::utl::parse_args().
| #define ARG_MIDHOLDTIME 279 |
Referenced by olsr::utl::parse_args().
| #define ARG_MIDINTERVAL 277 |
Referenced by olsr::utl::parse_args().
| #define ARG_NEIGHBHOLDTIME 281 |
Referenced by olsr::utl::parse_args().
| #define ARG_NOTABLES 270 |
Referenced by olsr::utl::parse_args().
| #define ARG_NOTICEFILE 265 |
Referenced by olsr::utl::parse_args().
| #define ARG_QUEUESIZE 289 |
Referenced by olsr::utl::parse_args().
| #define ARG_REFRESHINTERVAL 275 |
Referenced by olsr::utl::parse_args().
| #define ARG_SWSOCK 271 |
Referenced by olsr::utl::parse_args().
| #define ARG_TCINTERVAL 276 |
Referenced by olsr::utl::parse_args().
| #define ARG_TOPHOLDTIME 282 |
Referenced by olsr::utl::parse_args().
| #define ARG_VERSION 256 |
Referenced by olsr::utl::parse_args().
| #define ARG_WARNINGFILE 264 |
Referenced by olsr::utl::parse_args().
| #define GETFLOAT | ( | Variable, | |||
| Option | ) |
Value:
do { \ char* p; \ double val = strtod(optarg, &p); \ if (p == optarg || *p != 0 || val == 0) \ die("Parse error in --" Option ": %s\n", optarg); \ cst:: Variable = val; \ } while (0)
Referenced by olsr::utl::parse_args().
| #define GETNUMBER | ( | Variable, | |||
| Option | ) |
Value:
do { \ char* p; \ unsigned val = strtoul(optarg, &p, 10); \ if (p == optarg || *p != 0 || val == 0) \ die("Parse error in --" Option ": %s\n", optarg); \ cst:: Variable = val; \ } while (0)
Referenced by olsr::utl::parse_args().
| #define PROC_BUF | ( | Name, | |||
| Buf | ) |
Value:
do { \ bufmap_t::iterator x = buf_map.find( Name ## _file); \ if (x == buf_map.end()) { \ std::filebuf* b = new std::filebuf; \ b->open( Name ## _file.c_str(), \ std::ios_base::out | std::ios_base::app); \ if (!b->is_open()) \ die("Could not open \"%s\" for writing: %s\n", \ Name ## _file.c_str(), strerror(errno)); \ x = buf_map.insert(bufmap_t:: \ value_type( Name ## _file, b)).first; \ } \ Buf ->set_streambuf(x->second); \ } while (false)
| #define PROC_LOG | ( | Name, | |||
| Level | ) |
Value:
do { \ if ( Name ## _file.empty()) { \ std::streambuf* b; \ \ if(debugtrace) { \ assert(dynamic_cast<YBuf*>( Name .rdbuf()) != 0); \ YBuf* yb = static_cast<YBuf*>( Name .rdbuf()); \ b = yb->get_streambuf1(); \ } else \ b = Name .rdbuf(); \ \ assert(dynamic_cast<LevelBuf*>(b) != 0); \ LevelBuf* lb = static_cast<LevelBuf*>(b); \ \ if (timestamps) { \ assert(dynamic_cast<TimestampBuf*>(lb->get_streambuf()) != 0); \ delete static_cast<TimestampBuf*>(lb->get_streambuf()); \ } \ \ lb->set_streambuf(new utl::SyslogBuf( Level )); \ } \ } while (false)
| #define PROC_LOG | ( | Name | ) |
Value:
do { \ if (! Name ## _file.empty()) { \ assert(dynamic_cast<LevelBuf*>( Name .rdbuf()) != 0); \ LevelBuf* b = static_cast<LevelBuf*>( Name .rdbuf()); \ if (timestamps) { \ TimestampBuf* tb = \ new TimestampBuf(b->get_streambuf()); \ PROC_BUF( Name , tb); \ b->set_streambuf(tb); \ } else \ PROC_BUF( Name , b); \ } else if (timestamps) { \ assert(dynamic_cast<LevelBuf*>( Name .rdbuf()) != 0); \ LevelBuf* b = static_cast<LevelBuf*>( Name .rdbuf()); \ TimestampBuf* tb = new TimestampBuf(b->get_streambuf()); \ b->set_streambuf(tb); \ } \ } while (false)
Referenced by olsr::utl::output_syslog(), and olsr::utl::parse_args().
| #define PROC_LOG_PREFIXED | ( | Name, | |||
| Level | ) |
Value:
do { \ if ( Name ## _file.empty()) { \ std::streambuf* b; \ \ if(debugtrace) { \ assert(dynamic_cast<YBuf*>( Name .rdbuf()) != 0); \ YBuf* yb = static_cast<YBuf*>( Name .rdbuf()); \ b = yb->get_streambuf1(); \ } else \ b = Name .rdbuf(); \ \ assert(dynamic_cast<LevelBuf*>(b) != 0); \ LevelBuf* lb = static_cast<LevelBuf*>(b); \ assert(dynamic_cast< SPB *>(lb->get_streambuf()) != 0); \ SPB * sb = static_cast<SPB *>(lb->get_streambuf()); \ \ if (timestamps) { \ assert(dynamic_cast<TimestampBuf*>(sb->get_streambuf()) != 0); \ delete static_cast<TimestampBuf*>(sb->get_streambuf()); \ } \ \ sb->set_streambuf(new utl::SyslogBuf( Level )); \ } \ } while (false)
| #define PROC_LOG_PREFIXED | ( | Name | ) |
Value:
do { \ if (! Name ## _file.empty()) { \ assert(dynamic_cast<LevelBuf*>( Name .rdbuf()) != 0); \ LevelBuf* b = static_cast<LevelBuf*>( Name .rdbuf()); \ assert(dynamic_cast< SPB *>(b->get_streambuf()) != 0); \ SPB * sb = static_cast< SPB *>(b->get_streambuf()); \ if (timestamps) { \ TimestampBuf* tb = \ new TimestampBuf(sb->get_streambuf()); \ PROC_BUF( Name , tb); \ sb->set_streambuf(tb); \ } else \ PROC_BUF( Name , sb); \ } else if (timestamps) { \ assert(dynamic_cast<LevelBuf*>( Name .rdbuf()) != 0); \ LevelBuf* b = static_cast<LevelBuf*>( Name .rdbuf()); \ assert(dynamic_cast< SPB *>(b->get_streambuf()) != 0); \ SPB * sb = static_cast< SPB *>(b->get_streambuf()); \ TimestampBuf* tb = new TimestampBuf(sb->get_streambuf()); \ sb->set_streambuf(tb); \ } \ } while (false)
Referenced by olsr::utl::output_syslog(), and olsr::utl::parse_args().
| #define QOLYESTER_DAEMON_UTL_ARGS_HXX 1 |
| #define SPB StringPrefixBuf |
| #define SPB StringPrefixBuf |
1.5.6