diff options
author | Ben Pfaff <blp@nicira.com> | 2010-05-05 10:31:44 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-05-11 11:50:45 -0700 |
commit | 1e3c004749e1e0498dac6240b6edda472718dde2 (patch) | |
tree | 1e23164258304afce1f61f167436b3b4333ce11c /lib/stream.h | |
parent | c088c3be069e991e2d8a3acfdcbb9af278c6d5e5 (diff) |
Diagnose attempts to connect the wrong protocol to a network port.
Sometimes, when a user asks me to help debug a problem, it turns out that
an SSL connection was being made on a TCP port, or vice versa, or that an
OpenFlow connection was being made on a JSON-RPC port, or vice versa, and
so on. This commit adds log messages that diagnose this kind of problem,
e.g. "tcp:127.0.0.1:6633: received JSON-RPC data on OpenFlow channel".
Diffstat (limited to 'lib/stream.h')
-rw-r--r-- | lib/stream.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/stream.h b/lib/stream.h index d8b08146..256667e6 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -20,6 +20,7 @@ #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#include "vlog.h" struct pstream; struct stream; @@ -72,5 +73,17 @@ int pstream_open_with_default_ports(const char *name, uint16_t default_ptcp_port, uint16_t default_pssl_port, struct pstream **); + +/* Error reporting. */ + +enum stream_content_type { + STREAM_UNKNOWN, + STREAM_OPENFLOW, + STREAM_SSL, + STREAM_JSONRPC +}; + +void stream_report_content(const void *, size_t, enum stream_content_type, + enum vlog_module, const char *stream_name); #endif /* stream.h */ |