Permalink
Browse files

Option --dump-no-syslog für Telican Damit man Syslogmeldungen unterdr…

…ücken kann
  • Loading branch information...
RealMerlin committed Nov 29, 2018
1 parent 1504662 commit 5eedfb2264ddf4c72d59f12ec8db2152ef7afb0c
Showing with 17 additions and 4 deletions.
  1. +5 −1 libhcan++/transport_connection.cc
  2. +1 −1 libhcan++/transport_connection.h
  3. +11 −2 telican/main.cc
@@ -397,7 +397,7 @@ void transport_connection::syslog()
}
}

void transport_connection::dump(bool numeric, bool color)
void transport_connection::dump(bool numeric, bool color, bool syslog)
{
// this fills the frame_message_description vector
// (see mk_frame_message_description_h.xsl for details)
@@ -410,6 +410,10 @@ void transport_connection::dump(bool numeric, bool color)
{
const frame f = frame::read_from(m_socket);
keep_connection_alive();
if ((!syslog) && (f.proto() == 3) && (f.dst() == HCAN_MULTICAST_SYSLOG))
{
continue;
}

f.print(numeric,color,"");

@@ -37,7 +37,7 @@ namespace hcan
void ping(uint16_t src, uint16_t dst);
void ping_once(uint16_t src, uint16_t dst);
void flood_ping(uint16_t src, uint16_t dst, const int load);
void dump(bool numeric, bool color);
void dump(bool numeric, bool color, bool syslog);
void templog();
void syslog();
void send(const frame &f);
@@ -133,6 +133,7 @@ void run_timed_mode(const po::variables_map &map)
--templog
--syslog
--dump
--dump-no-syslog
--ping
--floodping
--pingonce
@@ -188,10 +189,17 @@ void handle_given_options (const po::parsed_options &options,
hcan::transport_connection con(hcand_ip);
const bool numeric = map.count("numeric");
const bool nocolor = map.count("nocolor");
con.dump(numeric, !nocolor);
con.dump(numeric, !nocolor, true);
exit(0);
}

if (map.count("dump-no-syslog"))
{
hcan::transport_connection con(hcand_ip);
const bool numeric = map.count("numeric");
const bool nocolor = map.count("nocolor");
con.dump(numeric, !nocolor, false);
exit(0);
}

// Standard NonPolite
if (map.count("polite-time"))
@@ -469,6 +477,7 @@ int main (int argc, char *argv[])
("help,h", "shows the available options")
("ip-address,a", po::value<string>(), "IP adress of hcand (default 127.0.0.1)")
("dump,d", "dump mode; dump all messages")
("dump-no-syslog,D", "dump mode; dump all messages; exept of syslog messages")
("nocolor", "no color in dump mode")
("numeric,n", "in dump mode, print frame data as numbers")
("ping,p", po::value<uint16_t>(),

0 comments on commit 5eedfb2

Please sign in to comment.