#include <string.h>
#include "buffer.h"
#include "flow.h"
+#include "ofp-print.h"
#include "openflow.h"
#include "poll-loop.h"
#include "util.h"
int retval = vconn_connect(vconn);
if (!retval) {
retval = (vconn->class->recv)(vconn, msgp);
+ if (VLOG_IS_DBG_ENABLED() && !retval) {
+ char *s = ofp_to_string((*msgp)->data, (*msgp)->size, 1);
+ VLOG_DBG("received: %s", s);
+ free(s);
+ }
}
if (retval) {
*msgp = NULL;
{
int retval = vconn_connect(vconn);
if (!retval) {
- retval = (vconn->class->send)(vconn, msg);
+ if (!VLOG_IS_DBG_ENABLED()) {
+ retval = (vconn->class->send)(vconn, msg);
+ } else {
+ char *s = ofp_to_string(msg->data, msg->size, 1);
+ retval = (vconn->class->send)(vconn, msg);
+ if (retval != EAGAIN) {
+ VLOG_DBG("sent (%s): %s", strerror(retval), s);
+ }
+ free(s);
+ }
}
return retval;
}