*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
CHECK_ERRNO(pstream_open(fpv->pvconn_name, &fpv->pstream), 0);
free(bind_path);
} else if (!strcmp(type, "tcp") || !strcmp(type, "ssl")) {
CHECK_ERRNO(pstream_open(fpv->pvconn_name, &fpv->pstream), 0);
free(bind_path);
} else if (!strcmp(type, "tcp") || !strcmp(type, "ssl")) {
/* Connects to a fake_pvconn with vconn_open(), then closes the listener and
* verifies that vconn_connect() reports 'expected_error'. */
static void
/* Connects to a fake_pvconn with vconn_open(), then closes the listener and
* verifies that vconn_connect() reports 'expected_error'. */
static void
- expected_error = !strcmp(type, "unix") ? EPIPE : ECONNRESET;
+ expected_error = (!strcmp(type, "unix") ? EPIPE
+ : !strcmp(type, "tcp") ? ECONNRESET
+ : EPROTO);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP_VERSION, &vconn), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn), 0);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP_VERSION, &vconn), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn), 0);
* reads the hello message from it, then closes the connection and verifies
* that vconn_connect() reports 'expected_error'. */
static void
* reads the hello message from it, then closes the connection and verifies
* that vconn_connect() reports 'expected_error'. */
static void
- CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP_VERSION, &vconn), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn), 0);
retval = stream_recv(stream, &hello, sizeof hello);
if (retval == sizeof hello) {
retval = stream_recv(stream, &hello, sizeof hello);
if (retval == sizeof hello) {
- CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP_VERSION, &vconn), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn), 0);
struct ofp_header hello;
int retval = stream_recv(stream, &hello, sizeof hello);
if (retval == sizeof hello) {
struct ofp_header hello;
int retval = stream_recv(stream, &hello, sizeof hello);
if (retval == sizeof hello) {
echo.type = OFPT_ECHO_REQUEST;
echo.length = htons(sizeof echo);
echo.xid = htonl(0x89abcdef);
echo.type = OFPT_ECHO_REQUEST;
echo.length = htons(sizeof echo);
echo.xid = htonl(0x89abcdef);
/* Try connecting and sending a hello packet that has its length field as 0,
* which should fail with EPROTO. */
static void
/* Try connecting and sending a hello packet that has its length field as 0,
* which should fail with EPROTO. */
static void
/* Try connecting and sending a hello packet that has a bad version, which
* should fail with EPROTO. */
static void
/* Try connecting and sending a hello packet that has a bad version, which
* should fail with EPROTO. */
static void
main(int argc, char *argv[])
{
set_program_name(argv[0]);
main(int argc, char *argv[])
{
set_program_name(argv[0]);
- time_init();
- vlog_init();
- vlog_set_levels(VLM_ANY_MODULE, VLF_ANY_FACILITY, VLL_EMER);
- vlog_set_levels(VLM_ANY_MODULE, VLF_CONSOLE, VLL_DBG);
+ vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_EMER);
+ vlog_set_levels(NULL, VLF_CONSOLE, VLL_DBG);