/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
* Distributed under the terms of the GNU GPL version 2.
*
* Significant portions of this file may be copied from parts of the Linux
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <net/genetlink.h>
+#include "brc_procfs.h"
#include "openvswitch/brcompat-netlink.h"
/* This code implements a Generic Netlink command BRC_GENL_C_SET_PROC that can
static struct proc_dir_entry *proc_vlan_dir;
static struct proc_dir_entry *proc_bonding_dir;
-struct proc_dir_entry *brc_lookup_entry(struct proc_dir_entry *de, const char *name)
+static struct proc_dir_entry *brc_lookup_entry(struct proc_dir_entry *de, const char *name)
{
int namelen = strlen(name);
for (de = de->subdir; de; de = de->next) {
}
EXPORT_SYMBOL_GPL(get_dp);
-struct datapath *get_dp_locked(int dp_idx)
+static struct datapath *get_dp_locked(int dp_idx)
{
struct datapath *dp;
kfree(dp);
}
-struct kobj_type dp_ktype = {
+static struct kobj_type dp_ktype = {
.release = release_dp
};
kfree(p);
}
-struct kobj_type brport_ktype = {
+static struct kobj_type brport_ktype = {
#ifdef CONFIG_SYSFS
.sysfs_ops = &brport_sysfs_ops,
#endif
set_dp_devs_mtu(dp, dev);
dp_sysfs_add_if(dp->ports[port_no]);
- err = __put_user(port_no, &port.port);
+ err = __put_user(port_no, &portp->port);
out_put:
dev_put(dev);
}
static void
-restore_terminal(void *aux UNUSED)
+restore_terminal(void *aux OVS_UNUSED)
{
endwin();
}
}
static void
-sigusr1_handler(int signr UNUSED)
+sigusr1_handler(int signr OVS_UNUSED)
{
sigusr1_triggered = true;
}
}
static void
-cmd_show_version(const struct dict *dict UNUSED)
+cmd_show_version(const struct dict *dict OVS_UNUSED)
{
show_string(VERSION BUILDNR);
}
}
static void
-cmd_shell(const struct dict *dict UNUSED)
+cmd_shell(const struct dict *dict OVS_UNUSED)
{
const char *home;
}
static void
-cmd_show_motto(const struct dict *dict UNUSED)
+cmd_show_motto(const struct dict *dict OVS_UNUSED)
{
show_string("\"Just Add Ice\"");
}
}
static void
-cmd_configure(const struct dict *dict UNUSED)
+cmd_configure(const struct dict *dict OVS_UNUSED)
{
bool debug_mode = dict_get_bool(dict, "debug", false);
struct dict config_dict;
}
static void
-cmd_set_up_pki(const struct dict *dict UNUSED)
+cmd_set_up_pki(const struct dict *dict OVS_UNUSED)
{
static const char def_privkey_file[]
= "/etc/openflow-switch/of0-privkey.pem";
-/* Copyright (c) 2008, 2009 Nicira Networks, Inc.
+/* Copyright (c) 2008, 2009, 2010 Nicira Networks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
void
-terminal_wait(struct terminal *term UNUSED, int input_fd)
+terminal_wait(struct terminal *term OVS_UNUSED, int input_fd)
{
poll_fd_wait(input_fd, POLLIN);
}
}
int
-tty_set_window_size(int fd UNUSED, int rows UNUSED, int columns UNUSED)
+tty_set_window_size(int fd OVS_UNUSED,
+ int rows OVS_UNUSED,
+ int columns OVS_UNUSED)
{
#ifdef TIOCGWINSZ
struct winsize win;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define THIS_MODULE VLM_backtrace
#include "vlog.h"
-static uintptr_t UNUSED
+static uintptr_t OVS_UNUSED
get_max_stack(void)
{
static const char file_name[] = "/proc/self/maps";
/* Stubs that don't do anything on non-Linux systems. */
void
-proctitle_init(int argc UNUSED, char **argv UNUSED)
+proctitle_init(int argc OVS_UNUSED, char **argv OVS_UNUSED)
{
}
void
-proctitle_set(const char *format UNUSED, ...)
+proctitle_set(const char *format OVS_UNUSED, ...)
{
}
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define COMPILER_H 1
#define NO_RETURN __attribute__((__noreturn__))
-#define UNUSED __attribute__((__unused__))
+#define OVS_UNUSED __attribute__((__unused__))
#define PACKED __attribute__((__packed__))
#define PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1)))
#define STRFTIME_FORMAT(FMT) __attribute__((__format__(__strftime__, FMT, 0)))
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static unsigned int epoch;
static void
-coverage_unixctl_log(struct unixctl_conn *conn, const char *args UNUSED,
- void *aux UNUSED)
+coverage_unixctl_log(struct unixctl_conn *conn, const char *args OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
coverage_log(VLL_WARN, false);
unixctl_command_reply(conn, 200, NULL);
unsigned int word_mask = 1u << (bit_index % BITS_PER_WORD);
if (hit[word_index] & word_mask) {
- return true;
+ return true;
} else {
hit[word_index] |= word_mask;
return false;
}
static void
-dhclient_run_RELEASED(struct dhclient *cli UNUSED)
+dhclient_run_RELEASED(struct dhclient *cli OVS_UNUSED)
{
/* Nothing to do. */
}
msg->giaddr = dhcp->giaddr;
memcpy(msg->chaddr, dhcp->chaddr, ETH_ADDR_LEN);
- cookie = ofpbuf_try_pull(&b, sizeof cookie);
+ cookie = ofpbuf_try_pull(&b, sizeof *cookie);
if (cookie) {
if (ntohl(*cookie) == DHCP_OPTS_COOKIE) {
uint8_t overload;
}
static int
-dpif_linux_open(const char *name, const char *type UNUSED, bool create,
+dpif_linux_open(const char *name, const char *type OVS_UNUSED, bool create,
struct dpif **dpifp)
{
int minor;
}
static int
-dpif_netdev_open(const char *name, const char *type UNUSED, bool create,
+dpif_netdev_open(const char *name, const char *type OVS_UNUSED, bool create,
struct dpif **dpifp)
{
if (create) {
}
static int
-dpif_netdev_port_poll(const struct dpif *dpif_, char **devnamep UNUSED)
+dpif_netdev_port_poll(const struct dpif *dpif_, char **devnamep OVS_UNUSED)
{
struct dpif_netdev *dpif = dpif_netdev_cast(dpif_);
if (dpif->dp_serial != dpif->dp->serial) {
}
static void
-unlink_files(void *aux UNUSED)
+unlink_files(void *aux OVS_UNUSED)
{
do_unlink_files();
}
static void
-cancel_files(void *aux UNUSED)
+cancel_files(void *aux OVS_UNUSED)
{
shash_clear(&files);
added_hook = false;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#ifndef HAVE_MALLOC_HOOKS
void
-leak_checker_start(const char *file_name UNUSED)
+leak_checker_start(const char *file_name OVS_UNUSED)
{
VLOG_WARN("not enabling leak checker because the libc in use does not "
"have the required hooks");
}
void
-leak_checker_set_limit(off_t max_size UNUSED)
+leak_checker_set_limit(off_t max_size OVS_UNUSED)
{
}
void
-leak_checker_claim(const void *p UNUSED)
+leak_checker_claim(const void *p OVS_UNUSED)
{
}
}
static void *
-hook_malloc(size_t size, const void *caller UNUSED)
+hook_malloc(size_t size, const void *caller OVS_UNUSED)
{
void *p;
}
static void
-hook_free(void *p, const void *caller UNUSED)
+hook_free(void *p, const void *caller OVS_UNUSED)
{
if (!p) {
return;
}
static void *
-hook_realloc(void *p, size_t size, const void *caller UNUSED)
+hook_realloc(void *p, size_t size, const void *caller OVS_UNUSED)
{
void *q;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static void
-process_phy_port(struct lswitch *sw, struct rconn *rconn UNUSED, void *opp_)
+process_phy_port(struct lswitch *sw, struct rconn *rconn OVS_UNUSED,
+ void *opp_)
{
const struct ofp_phy_port *opp = opp_;
uint16_t port_no = ntohs(opp->port_no);
static void
netdev_linux_cache_cb(const struct rtnetlink_change *change,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
struct netdev_dev_linux *dev;
if (change) {
/* The arguments are marked as unused to prevent warnings on platforms where
* the Netlink interface isn't supported. */
static int
-setup_gre_netlink(const char *name UNUSED, struct gre_config *config UNUSED,
- bool create UNUSED)
+setup_gre_netlink(const char *name OVS_UNUSED,
+ struct gre_config *config OVS_UNUSED, bool create OVS_UNUSED)
{
#ifdef GRE_IOCTL_ONLY
return EOPNOTSUPP;
/* The arguments are marked as unused to prevent warnings on platforms where
* the Netlink interface isn't supported. */
static bool
-check_gre_device_netlink(const char *name UNUSED)
+check_gre_device_netlink(const char *name OVS_UNUSED)
{
#ifdef GRE_IOCTL_ONLY
return false;
/* Creates the netdev device of 'type' with 'name'. */
static int
-netdev_linux_create_system(const char *name, const char *type UNUSED,
+netdev_linux_create_system(const char *name, const char *type OVS_UNUSED,
const struct shash *args, struct netdev_dev **netdev_devp)
{
struct netdev_dev_linux *netdev_dev;
* buffers, across all readers. Therefore once data is read it will
* be unavailable to other reads for tap devices. */
static int
-netdev_linux_create_tap(const char *name, const char *type UNUSED,
+netdev_linux_create_tap(const char *name, const char *type OVS_UNUSED,
const struct shash *args, struct netdev_dev **netdev_devp)
{
struct netdev_dev_linux *netdev_dev;
}
static int
-netdev_linux_create_gre(const char *name, const char *type UNUSED,
+netdev_linux_create_gre(const char *name, const char *type OVS_UNUSED,
const struct shash *args, struct netdev_dev **netdev_devp)
{
struct netdev_dev_linux *netdev_dev;
/* The arguments are marked as unused to prevent warnings on platforms where
* the Netlink interface isn't supported. */
static int
-destroy_gre_netlink(const char *name UNUSED)
+destroy_gre_netlink(const char *name OVS_UNUSED)
{
#ifdef GRE_IOCTL_ONLY
return EOPNOTSUPP;
/* Adds 'router' as a default IP gateway. */
static int
-netdev_linux_add_router(struct netdev *netdev UNUSED, struct in_addr router)
+netdev_linux_add_router(struct netdev *netdev OVS_UNUSED, struct in_addr router)
{
struct in_addr any = { INADDR_ANY };
struct rtentry rt;
static void
netdev_linux_poll_cb(const struct rtnetlink_change *change,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
if (change) {
struct list *list = shash_find_data(&netdev_linux_notifiers,
* additional log messages. */
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
-static void close_all_netdevs(void *aux UNUSED);
+static void close_all_netdevs(void *aux OVS_UNUSED);
static int restore_flags(struct netdev *netdev);
void update_device_args(struct netdev_dev *, const struct shash *args);
/* Close all netdevs on shutdown so they can do any needed cleanup such as
* destroying devices, restoring flags, etc. */
static void
-close_all_netdevs(void *aux UNUSED)
+close_all_netdevs(void *aux OVS_UNUSED)
{
struct netdev *netdev, *next;
LIST_FOR_EACH_SAFE(netdev, next, struct netdev, node, &netdev_list) {
#include <stddef.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Generic interface to network devices.
*
* Currently, there is a single implementation of this interface that supports
int netdev_monitor_poll(struct netdev_monitor *, char **devnamep);
void netdev_monitor_poll_wait(const struct netdev_monitor *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* netdev.h */
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* This starts and kills a tcpdump subprocess so it's quite expensive. */
char *
-ofp_packet_to_string(const void *data, size_t len, size_t total_len UNUSED)
+ofp_packet_to_string(const void *data, size_t len, size_t total_len OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct ofpbuf buf;
* 'string' at the given 'verbosity' level. */
static void
ofp_print_switch_features(struct ds *string, const void *oh, size_t len,
- int verbosity UNUSED)
+ int verbosity OVS_UNUSED)
{
const struct ofp_switch_features *osf = oh;
struct ofp_phy_port *port_list;
/* Pretty-print the struct ofp_switch_config of 'len' bytes at 'oh' to 'string'
* at the given 'verbosity' level. */
static void
-ofp_print_switch_config(struct ds *string, const void *oh, size_t len UNUSED,
- int verbosity UNUSED)
+ofp_print_switch_config(struct ds *string, const void *oh,
+ size_t len OVS_UNUSED, int verbosity OVS_UNUSED)
{
const struct ofp_switch_config *osc = oh;
uint16_t flags;
/* Pretty-print the OFPT_FLOW_EXPIRED packet of 'len' bytes at 'oh' to 'string'
* at the given 'verbosity' level. */
static void
-ofp_print_flow_expired(struct ds *string, const void *oh, size_t len UNUSED,
- int verbosity)
+ofp_print_flow_expired(struct ds *string, const void *oh,
+ size_t len OVS_UNUSED, int verbosity)
{
const struct ofp_flow_expired *ofe = oh;
}
static void
-ofp_print_port_mod(struct ds *string, const void *oh, size_t len UNUSED,
- int verbosity UNUSED)
+ofp_print_port_mod(struct ds *string, const void *oh, size_t len OVS_UNUSED,
+ int verbosity OVS_UNUSED)
{
const struct ofp_port_mod *opm = oh;
* at the given 'verbosity' level. */
static void
ofp_print_error_msg(struct ds *string, const void *oh, size_t len,
- int verbosity UNUSED)
+ int verbosity OVS_UNUSED)
{
const struct ofp_error_msg *oem = oh;
int type = ntohs(oem->type);
/* Pretty-print the OFPT_PORT_STATUS packet of 'len' bytes at 'oh' to 'string'
* at the given 'verbosity' level. */
static void
-ofp_print_port_status(struct ds *string, const void *oh, size_t len UNUSED,
- int verbosity UNUSED)
+ofp_print_port_status(struct ds *string, const void *oh, size_t len OVS_UNUSED,
+ int verbosity OVS_UNUSED)
{
const struct ofp_port_status *ops = oh;
}
static void
-ofp_desc_stats_reply(struct ds *string, const void *body, size_t len UNUSED,
- int verbosity UNUSED)
+ofp_desc_stats_reply(struct ds *string, const void *body,
+ size_t len OVS_UNUSED, int verbosity OVS_UNUSED)
{
const struct ofp_desc_stats *ods = body;
}
static void
-ofp_flow_stats_request(struct ds *string, const void *oh, size_t len UNUSED,
- int verbosity)
+ofp_flow_stats_request(struct ds *string, const void *oh,
+ size_t len OVS_UNUSED, int verbosity)
{
const struct ofp_flow_stats_request *fsr = oh;
static void
ofp_aggregate_stats_request(struct ds *string, const void *oh,
- size_t len UNUSED, int verbosity)
+ size_t len OVS_UNUSED, int verbosity)
{
const struct ofp_aggregate_stats_request *asr = oh;
static void
ofp_aggregate_stats_reply(struct ds *string, const void *body_,
- size_t len UNUSED, int verbosity UNUSED)
+ size_t len OVS_UNUSED, int verbosity OVS_UNUSED)
{
const struct ofp_aggregate_stats_reply *asr = body_;
static void
vendor_stat(struct ds *string, const void *body, size_t len,
- int verbosity UNUSED)
+ int verbosity OVS_UNUSED)
{
ds_put_format(string, " vendor=%08"PRIx32, ntohl(*(uint32_t *) body));
ds_put_format(string, " %zu bytes additional data",
b->size = 0;
b->l2 = b->l3 = b->l4 = b->l7 = NULL;
b->next = NULL;
- b->private = NULL;
+ b->private_p = NULL;
}
/* Initializes 'b' as an empty ofpbuf with an initial capacity of 'size'
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated
* as necessary if it grows too large for the available memory. */
struct ofpbuf {
void *l7; /* Application data. */
struct ofpbuf *next; /* Next in a list of ofpbufs. */
- void *private; /* Private pointer for use by owner. */
+ void *private_p; /* Private pointer for use by owner. */
};
void ofpbuf_use(struct ofpbuf *, void *, size_t);
void *ofpbuf_pull(struct ofpbuf *, size_t);
void *ofpbuf_try_pull(struct ofpbuf *, size_t);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ofpbuf.h */
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define ETH_ADDR_LEN 6
-static const uint8_t eth_addr_broadcast[ETH_ADDR_LEN] UNUSED
+static const uint8_t eth_addr_broadcast[ETH_ADDR_LEN] OVS_UNUSED
= { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static inline bool eth_addr_is_broadcast(const uint8_t ea[6])
static bool sigchld_is_blocked(void);
static void block_sigchld(sigset_t *);
static void unblock_sigchld(const sigset_t *);
-static void sigchld_handler(int signr UNUSED);
+static void sigchld_handler(int signr OVS_UNUSED);
static bool is_member(int x, const int *array, size_t);
/* Initializes the process subsystem (if it is not already initialized). Calls
}
\f
static void
-sigchld_handler(int signr UNUSED)
+sigchld_handler(int signr OVS_UNUSED)
{
struct process *p;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/* Checks the internal integrity of 'q'. For use in debugging. */
static void
-check_queue(struct ovs_queue *q UNUSED)
+check_queue(struct ovs_queue *q OVS_UNUSED)
{
#if 0
struct ofpbuf *iter;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static unsigned int
-timeout_VOID(const struct rconn *rc UNUSED)
+timeout_VOID(const struct rconn *rc OVS_UNUSED)
{
return UINT_MAX;
}
static void
-run_VOID(struct rconn *rc UNUSED)
+run_VOID(struct rconn *rc OVS_UNUSED)
{
/* Nothing to do. */
}
if (rconn_is_connected(rc)) {
COVERAGE_INC(rconn_queued);
copy_to_monitor(rc, b);
- b->private = counter;
+ b->private_p = counter;
if (counter) {
rconn_packet_counter_inc(counter);
}
{
int retval = 0;
struct ofpbuf *next = rc->txq.head->next;
- struct rconn_packet_counter *counter = rc->txq.head->private;
+ struct rconn_packet_counter *counter = rc->txq.head->private_p;
retval = vconn_send(rc->vconn, rc->txq.head);
if (retval) {
if (retval != EAGAIN) {
}
while (rc->txq.n > 0) {
struct ofpbuf *b = queue_pop_head(&rc->txq);
- struct rconn_packet_counter *counter = b->private;
+ struct rconn_packet_counter *counter = b->private_p;
if (counter) {
rconn_packet_counter_dec(counter);
}
#include "hmap.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct shash_node {
struct hmap_node node;
char *name;
const struct shash_node **shash_sort(const struct shash *);
bool shash_equal_keys(const struct shash *, const struct shash *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* shash.h */
*
* Returns the socket's fd if successful, otherwise a negative errno value. */
int
-make_unix_socket(int style, bool nonblock, bool passcred UNUSED,
+make_unix_socket(int style, bool nonblock, bool passcred OVS_UNUSED,
const char *bind_path, const char *connect_path)
{
int error;
static void ssl_clear_txbuf(struct ssl_stream *);
static int interpret_ssl_error(const char *function, int ret, int error,
int *want);
-static DH *tmp_dh_callback(SSL *ssl, int is_export UNUSED, int keylength);
+static DH *tmp_dh_callback(SSL *ssl, int is_export OVS_UNUSED, int keylength);
static void log_ca_cert(const char *file_name, X509 *cert);
static short int
}
static int
-pssl_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
+pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp)
{
struct pssl_pstream *pssl;
struct sockaddr_in sin;
}
static DH *
-tmp_dh_callback(SSL *ssl UNUSED, int is_export UNUSED, int keylength)
+tmp_dh_callback(SSL *ssl OVS_UNUSED, int is_export OVS_UNUSED, int keylength)
{
struct dh {
int keylength;
struct stream **streamp);
static int
-ptcp_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
+ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp)
{
struct sockaddr_in sin;
char bound_name[128];
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
struct stream **streamp);
static int
-punix_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
+punix_open(const char *name OVS_UNUSED, char *suffix,
+ struct pstream **pstreamp)
{
int fd, error;
* connection methods supported by the stream. */
void
stream_usage(const char *name, bool active, bool passive,
- bool bootstrap UNUSED)
+ bool bootstrap OVS_UNUSED)
{
/* Really this should be implemented via callbacks into the stream
* providers, but that seems too heavy-weight to bother with at the
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "type-props.h"
#include "util.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct pollfd;
struct timeval;
long long int timeval_to_msec(const struct timeval *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* timeval.h */
static struct shash commands = SHASH_INITIALIZER(&commands);
static void
-unixctl_help(struct unixctl_conn *conn, const char *args UNUSED,
- void *aux UNUSED)
+unixctl_help(struct unixctl_conn *conn, const char *args OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct shash_node *node;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* __attribute__((warn_unused_result)) and you genuinely want to ignore
* its return value. (Note that every scalar type can be implicitly
* converted to bool.) */
-void ignore(bool x UNUSED) { }
+void ignore(bool x OVS_UNUSED) { }
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
char *dir_name(const char *file_name);
-void ignore(bool x UNUSED);
+void ignore(bool x OVS_UNUSED);
#ifdef __cplusplus
}
*
* Returns 0 if successful, otherwise a positive errno value. */
static int
-vconn_stream_open(const char *name_, char *suffix UNUSED,
+vconn_stream_open(const char *name_, char *suffix OVS_UNUSED,
struct vconn **vconnp)
{
struct stream *stream;
* Returns 0 if successful, otherwise a positive errno value. (The current
* implementation never fails.) */
static int
-pvconn_pstream_listen(const char *name_, char *suffix UNUSED,
+pvconn_pstream_listen(const char *name_, char *suffix OVS_UNUSED,
struct pvconn **pvconnp)
{
struct pvconn_pstream *ps;
* connection methods supported by the vconn. If 'bootstrap' is true, also
* advertises options to bootstrap the CA certificate. */
void
-vconn_usage(bool active, bool passive, bool bootstrap UNUSED)
+vconn_usage(bool active, bool passive, bool bootstrap OVS_UNUSED)
{
/* Really this should be implemented via callbacks into the vconn
* providers, but that seems too heavy-weight to bother with at the
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static void
-vlog_unixctl_set(struct unixctl_conn *conn, const char *args, void *aux UNUSED)
+vlog_unixctl_set(struct unixctl_conn *conn,
+ const char *args, void *aux OVS_UNUSED)
{
char *msg = vlog_set_levels_from_string(args);
unixctl_command_reply(conn, msg ? 501 : 202, msg);
static void
vlog_unixctl_list(struct unixctl_conn *conn,
- const char *args UNUSED, void *aux UNUSED)
+ const char *args OVS_UNUSED, void *aux OVS_UNUSED)
{
char *msg = vlog_get_levels();
unixctl_command_reply(conn, 200, msg);
static void
vlog_unixctl_reopen(struct unixctl_conn *conn,
- const char *args UNUSED, void *aux UNUSED)
+ const char *args OVS_UNUSED, void *aux OVS_UNUSED)
{
if (log_file_name) {
int error = vlog_reopen_log_file();
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static void
-modify_dhcp_request(struct dhcp_msg *msg, void *aux UNUSED)
+modify_dhcp_request(struct dhcp_msg *msg, void *aux OVS_UNUSED)
{
dhcp_msg_put_string(msg, DHCP_CODE_VENDOR_CLASS, "OpenFlow");
}
/* sFlow library callback to allocate memory. */
static void *
-sflow_agent_alloc_cb(void *magic UNUSED, SFLAgent *agent UNUSED, size_t bytes)
+sflow_agent_alloc_cb(void *magic OVS_UNUSED, SFLAgent *agent OVS_UNUSED,
+ size_t bytes)
{
return calloc(1, bytes);
}
/* sFlow library callback to free memory. */
static int
-sflow_agent_free_cb(void *magic UNUSED, SFLAgent *agent UNUSED, void *obj)
+sflow_agent_free_cb(void *magic OVS_UNUSED, SFLAgent *agent OVS_UNUSED,
+ void *obj)
{
free(obj);
return 0;
/* sFlow library callback to report error. */
static void
-sflow_agent_error_cb(void *magic UNUSED, SFLAgent *agent UNUSED, char *msg)
+sflow_agent_error_cb(void *magic OVS_UNUSED, SFLAgent *agent OVS_UNUSED,
+ char *msg)
{
VLOG_WARN("sFlow agent error: %s", msg);
}
/* sFlow library callback to send datagram. */
static void
-sflow_agent_send_packet_cb(void *os_, SFLAgent *agent UNUSED,
- SFLReceiver *receiver UNUSED, u_char *pkt,
+sflow_agent_send_packet_cb(void *os_, SFLAgent *agent OVS_UNUSED,
+ SFLReceiver *receiver OVS_UNUSED, u_char *pkt,
uint32_t pktLen)
{
struct ofproto_sflow *os = os_;
}
int
-ofproto_set_stp(struct ofproto *ofproto UNUSED, bool enable_stp)
+ofproto_set_stp(struct ofproto *ofproto OVS_UNUSED, bool enable_stp)
{
/* XXX */
if (enable_stp) {
struct ovsdb_error *
ovsdb_execute_commit(struct ovsdb_execution *x, struct ovsdb_parser *parser,
- struct json *result UNUSED)
+ struct json *result OVS_UNUSED)
{
const struct json *durable;
}
static struct ovsdb_error *
-ovsdb_execute_abort(struct ovsdb_execution *x UNUSED,
- struct ovsdb_parser *parser UNUSED,
- struct json *result UNUSED)
+ovsdb_execute_abort(struct ovsdb_execution *x OVS_UNUSED,
+ struct ovsdb_parser *parser OVS_UNUSED,
+ struct json *result OVS_UNUSED)
{
return ovsdb_error("aborted", "aborted by request");
}
static struct ovsdb_error *
ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser,
- struct json *result UNUSED)
+ struct json *result OVS_UNUSED)
{
struct ovsdb_table *table;
const struct json *timeout, *where, *columns_json, *until, *rows;
static struct ovsdb_error *
ovsdb_execute_comment(struct ovsdb_execution *x, struct ovsdb_parser *parser,
- struct json *result UNUSED)
+ struct json *result OVS_UNUSED)
{
const struct json *comment;
static struct ovsdb_error *
ovsdb_jsonrpc_monitor_commit(struct ovsdb_replica *replica,
- const struct ovsdb_txn *txn, bool durable UNUSED)
+ const struct ovsdb_txn *txn,
+ bool durable OVS_UNUSED)
{
struct ovsdb_jsonrpc_monitor *m = ovsdb_jsonrpc_monitor_cast(replica);
struct ovsdb_jsonrpc_monitor_aux aux;
}
\f
static void
-do_list_dbs(int argc UNUSED, char *argv[])
+do_list_dbs(int argc OVS_UNUSED, char *argv[])
{
struct jsonrpc_msg *request, *reply;
struct jsonrpc *rpc;
}
static void
-do_get_schema(int argc UNUSED, char *argv[])
+do_get_schema(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_schema *schema = fetch_schema(argv[1], argv[2]);
print_and_free_json(ovsdb_schema_to_json(schema));
}
static void
-do_list_tables(int argc UNUSED, char *argv[])
+do_list_tables(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_schema *schema;
struct shash_node *node;
}
static void
-do_list_columns(int argc UNUSED, char *argv[])
+do_list_columns(int argc OVS_UNUSED, char *argv[])
{
const char *table_name = argv[3];
struct ovsdb_schema *schema;
}
static void
-do_transact(int argc UNUSED, char *argv[])
+do_transact(int argc OVS_UNUSED, char *argv[])
{
struct jsonrpc_msg *request, *reply;
struct json *transaction;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
static bool inited;
-static void UNUSED
+static void OVS_UNUSED
do_set_regex(struct ovsdb_base_type *base, const char *reMatch,
const char *reComment)
{
else:
print '''
static void
-%(s)s_unparse_%(c)s(struct ovsdb_idl_row *row UNUSED)
+%(s)s_unparse_%(c)s(struct ovsdb_idl_row *row OVS_UNUSED)
{
/* Nothing to do. */
}''' % {'s': structName, 'c': columnName}
static void
-ovsdb_server_exit(struct unixctl_conn *conn, const char *args UNUSED,
+ovsdb_server_exit(struct unixctl_conn *conn, const char *args OVS_UNUSED,
void *exiting_)
{
bool *exiting = exiting_;
}
\f
static void
-do_create(int argc UNUSED, char *argv[])
+do_create(int argc OVS_UNUSED, char *argv[])
{
const char *db_file_name = argv[1];
const char *schema_file_name = argv[2];
}
static void
-do_query(int argc UNUSED, char *argv[])
+do_query(int argc OVS_UNUSED, char *argv[])
{
transact(true, argv[1], argv[2]);
}
static void
-do_transact(int argc UNUSED, char *argv[])
+do_transact(int argc OVS_UNUSED, char *argv[])
{
transact(false, argv[1], argv[2]);
}
}
static void
-do_show_log(int argc UNUSED, char *argv[])
+do_show_log(int argc OVS_UNUSED, char *argv[])
{
const char *db_file_name = argv[1];
struct shash names;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
}
void
-ovsdb_remove_replica(struct ovsdb *db UNUSED, struct ovsdb_replica *r)
+ovsdb_remove_replica(struct ovsdb *db OVS_UNUSED, struct ovsdb_replica *r)
{
list_remove(&r->node);
(r->class->destroy)(r);
}
static void
-modify_dhcp_request(struct dhcp_msg *msg, void *aux UNUSED)
+modify_dhcp_request(struct dhcp_msg *msg, void *aux OVS_UNUSED)
{
if (vendor_class) {
dhcp_msg_put_string(msg, DHCP_CODE_VENDOR_CLASS, vendor_class);
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <assert.h>
int
-main(int argc UNUSED, char *argv[])
+main(int argc OVS_UNUSED, char *argv[])
{
struct ofp_match expected_match;
FILE *flows, *pcap;
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static size_t
-constant_hash(int value UNUSED)
+constant_hash(int value OVS_UNUSED)
{
return 123;
}
}
static void
-do_listen(int argc UNUSED, char *argv[])
+do_listen(int argc OVS_UNUSED, char *argv[])
{
struct pstream *pstream;
struct jsonrpc **rpcs;
}
static void
-do_request(int argc UNUSED, char *argv[])
+do_request(int argc OVS_UNUSED, char *argv[])
{
struct jsonrpc_msg *msg;
struct jsonrpc *rpc;
}
static void
-do_notify(int argc UNUSED, char *argv[])
+do_notify(int argc OVS_UNUSED, char *argv[])
{
struct jsonrpc_msg *msg;
struct jsonrpc *rpc;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
}
static void
-do_parse_atomic_type(int argc UNUSED, char *argv[])
+do_parse_atomic_type(int argc OVS_UNUSED, char *argv[])
{
enum ovsdb_atomic_type type;
struct json *json;
}
static void
-do_parse_base_type(int argc UNUSED, char *argv[])
+do_parse_base_type(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_base_type base;
struct json *json;
}
static void
-do_parse_type(int argc UNUSED, char *argv[])
+do_parse_type(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_type type;
struct json *json;
}
static void
-do_sort_atoms(int argc UNUSED, char *argv[])
+do_sort_atoms(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_base_type base;
union ovsdb_atom *atoms;
}
static void
-do_parse_column(int argc UNUSED, char *argv[])
+do_parse_column(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_column *column;
struct json *json;
}
static void
-do_parse_table(int argc UNUSED, char *argv[])
+do_parse_table(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_table_schema *ts;
struct json *json;
}
static void
-do_evaluate_conditions(int argc UNUSED, char *argv[])
+do_evaluate_conditions(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_table_schema *ts;
struct ovsdb_table *table;
}
static void
-do_execute_mutations(int argc UNUSED, char *argv[])
+do_execute_mutations(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_table_schema *ts;
struct ovsdb_table *table;
}
static void
-do_query(int argc UNUSED, char *argv[])
+do_query(int argc OVS_UNUSED, char *argv[])
{
struct do_query_cbdata cbdata;
struct ovsdb_table_schema *ts;
};
static void
-do_query_distinct(int argc UNUSED, char *argv[])
+do_query_distinct(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_column_set columns;
struct ovsdb_table_schema *ts;
}
static void
-do_parse_schema(int argc UNUSED, char *argv[])
+do_parse_schema(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_schema *schema;
struct json *json;
}
static void
-do_execute(int argc UNUSED, char *argv[])
+do_execute(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_schema *schema;
struct json *json;
}
static void
-do_trigger(int argc UNUSED, char *argv[])
+do_trigger(int argc OVS_UNUSED, char *argv[])
{
struct ovsdb_schema *schema;
struct list completions;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
static struct ovsdb_table *do_transact_table;
static void
-do_transact_commit(int argc UNUSED, char *argv[] UNUSED)
+do_transact_commit(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
ovsdb_txn_commit(do_transact_txn, false);
do_transact_txn = NULL;
}
static void
-do_transact_abort(int argc UNUSED, char *argv[] UNUSED)
+do_transact_abort(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
ovsdb_txn_abort(do_transact_txn);
do_transact_txn = NULL;
}
static void
-do_transact_insert(int argc UNUSED, char *argv[] UNUSED)
+do_transact_insert(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
struct ovsdb_row *row;
struct uuid *uuid;
}
static void
-do_transact_delete(int argc UNUSED, char *argv[] UNUSED)
+do_transact_delete(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
const struct ovsdb_row *row = do_transact_find_row(argv[1]);
ovsdb_txn_row_delete(do_transact_txn, row);
}
static void
-do_transact_modify(int argc UNUSED, char *argv[] UNUSED)
+do_transact_modify(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
const struct ovsdb_row *row_ro;
struct ovsdb_row *row_rw;
}
static void
-do_transact_print(int argc UNUSED, char *argv[] UNUSED)
+do_transact_print(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
const struct ovsdb_row **rows;
const struct ovsdb_row *row;
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static void
-do_enable(int argc UNUSED, char *argv[] UNUSED)
+do_enable(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_enable(reconnect, now);
}
static void
-do_disable(int argc UNUSED, char *argv[] UNUSED)
+do_disable(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_disable(reconnect, now);
}
static void
-do_force_reconnect(int argc UNUSED, char *argv[] UNUSED)
+do_force_reconnect(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_force_reconnect(reconnect, now);
}
}
static void
-do_disconnected(int argc UNUSED, char *argv[])
+do_disconnected(int argc OVS_UNUSED, char *argv[])
{
reconnect_disconnected(reconnect, now, error_from_string(argv[1]));
}
static void
-do_connecting(int argc UNUSED, char *argv[] UNUSED)
+do_connecting(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_connecting(reconnect, now);
}
static void
-do_connect_failed(int argc UNUSED, char *argv[])
+do_connect_failed(int argc OVS_UNUSED, char *argv[])
{
reconnect_connect_failed(reconnect, now, error_from_string(argv[1]));
}
static void
-do_connected(int argc UNUSED, char *argv[] UNUSED)
+do_connected(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_connected(reconnect, now);
}
static void
-do_received(int argc UNUSED, char *argv[] UNUSED)
+do_received(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
reconnect_received(reconnect, now);
}
}
static void
-do_advance(int argc UNUSED, char *argv[])
+do_advance(int argc OVS_UNUSED, char *argv[])
{
now += atoi(argv[1]);
}
static void
-do_timeout(int argc UNUSED, char *argv[] UNUSED)
+do_timeout(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
int timeout = reconnect_timeout(reconnect, now);
if (timeout >= 0) {
}
static void
-do_set_max_tries(int argc UNUSED, char *argv[])
+do_set_max_tries(int argc OVS_UNUSED, char *argv[])
{
reconnect_set_max_tries(reconnect, atoi(argv[1]));
}
/* Connects to a fake_pvconn with vconn_open(), then closes the listener and
* verifies that vconn_connect() reports 'expected_error'. */
static void
-test_refuse_connection(int argc UNUSED, char *argv[])
+test_refuse_connection(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
int expected_error;
* closes it immediately, and verifies that vconn_connect() reports
* 'expected_error'. */
static void
-test_accept_then_close(int argc UNUSED, char *argv[])
+test_accept_then_close(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
int expected_error;
* reads the hello message from it, then closes the connection and verifies
* that vconn_connect() reports 'expected_error'. */
static void
-test_read_hello(int argc UNUSED, char *argv[])
+test_read_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct fake_pvconn fpv;
/* Try connecting and sending a normal hello, which should succeed. */
static void
-test_send_plain_hello(int argc UNUSED, char *argv[])
+test_send_plain_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct ofp_header hello;
* the specification says that implementations must accept and ignore extra
* data). */
static void
-test_send_long_hello(int argc UNUSED, char *argv[])
+test_send_long_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct ofp_header hello;
/* Try connecting and sending an echo request instead of a hello, which should
* fail with EPROTO. */
static void
-test_send_echo_hello(int argc UNUSED, char *argv[])
+test_send_echo_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct ofp_header echo;
/* Try connecting and sending a hello packet that has its length field as 0,
* which should fail with EPROTO. */
static void
-test_send_short_hello(int argc UNUSED, char *argv[])
+test_send_short_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct ofp_header hello;
/* Try connecting and sending a hello packet that has a bad version, which
* should fail with EPROTO. */
static void
-test_send_invalid_version_hello(int argc UNUSED, char *argv[])
+test_send_invalid_version_hello(int argc OVS_UNUSED, char *argv[])
{
const char *type = argv[1];
struct ofp_header hello;
};
int
-main(int argc, char *argv[])
+main(int argc OVS_UNUSED, char *argv[])
{
set_program_name(argv[0]);
time_init();
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
int
-main(int argc UNUSED, char *argv[])
+main(int argc OVS_UNUSED, char *argv[])
{
struct nl_sock *sock;
int error;
static bool exit_after_bind;
static bool iface_init(struct iface *, const char *netdev_name);
-static void release_ifaces(void *aux UNUSED);
+static void release_ifaces(void *aux OVS_UNUSED);
static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
}
static void
-release_ifaces(void *aux UNUSED)
+release_ifaces(void *aux OVS_UNUSED)
{
int i;
}
static void
-modify_dhcp_request(struct dhcp_msg *msg, void *aux UNUSED)
+modify_dhcp_request(struct dhcp_msg *msg, void *aux OVS_UNUSED)
{
dhcp_msg_put_string(msg, DHCP_CODE_VENDOR_CLASS, "OpenFlow");
}
static bool
-validate_dhcp_offer(const struct dhcp_msg *msg, void *aux UNUSED)
+validate_dhcp_offer(const struct dhcp_msg *msg, void *aux OVS_UNUSED)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 60);
char *vconn_name;
}
static void
-do_add_dp(int argc UNUSED, char *argv[])
+do_add_dp(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
run(parsed_dpif_open(argv[1], true, &dpif), "add_dp");
}
static void
-do_del_dp(int argc UNUSED, char *argv[])
+do_del_dp(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath");
}
static void
-do_add_if(int argc UNUSED, char *argv[])
+do_add_if(int argc OVS_UNUSED, char *argv[])
{
bool failure = false;
struct dpif *dpif;
}
static void
-do_del_if(int argc UNUSED, char *argv[])
+do_del_if(int argc OVS_UNUSED, char *argv[])
{
bool failure = false;
struct dpif *dpif;
}
static void
-do_dump_dps(int argc UNUSED, char *argv[] UNUSED)
+do_dump_dps(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
struct svec dpif_names, dpif_types;
unsigned int i;
}
static void
-do_dump_flows(int argc UNUSED, char *argv[])
+do_dump_flows(int argc OVS_UNUSED, char *argv[])
{
struct odp_flow *flows;
struct dpif *dpif;
}
static void
-do_del_flows(int argc UNUSED, char *argv[])
+do_del_flows(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
}
static void
-do_dump_groups(int argc UNUSED, char *argv[])
+do_dump_groups(int argc OVS_UNUSED, char *argv[])
{
struct odp_stats stats;
struct dpif *dpif;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static void
-do_show(int argc UNUSED, char *argv[])
+do_show(int argc OVS_UNUSED, char *argv[])
{
dump_trivial_transaction(argv[1], OFPT_FEATURES_REQUEST);
dump_trivial_transaction(argv[1], OFPT_GET_CONFIG_REQUEST);
}
static void
-do_dump_desc(int argc UNUSED, char *argv[])
+do_dump_desc(int argc OVS_UNUSED, char *argv[])
{
dump_trivial_stats_transaction(argv[1], OFPST_DESC);
}
static void
-do_dump_tables(int argc UNUSED, char *argv[])
+do_dump_tables(int argc OVS_UNUSED, char *argv[])
{
dump_trivial_stats_transaction(argv[1], OFPST_TABLE);
}
}
static void
-do_add_flow(int argc UNUSED, char *argv[])
+do_add_flow(int argc OVS_UNUSED, char *argv[])
{
struct vconn *vconn;
struct ofpbuf *buffer;
}
static void
-do_add_flows(int argc UNUSED, char *argv[])
+do_add_flows(int argc OVS_UNUSED, char *argv[])
{
struct vconn *vconn;
FILE *file;
}
static void
-do_mod_flows(int argc UNUSED, char *argv[])
+do_mod_flows(int argc OVS_UNUSED, char *argv[])
{
uint16_t priority, idle_timeout, hard_timeout;
struct vconn *vconn;
}
static void
-do_monitor(int argc UNUSED, char *argv[])
+do_monitor(int argc OVS_UNUSED, char *argv[])
{
struct vconn *vconn;
}
static void
-do_dump_ports(int argc UNUSED, char *argv[])
+do_dump_ports(int argc OVS_UNUSED, char *argv[])
{
dump_trivial_stats_transaction(argv[1], OFPST_PORT);
}
static void
-do_probe(int argc UNUSED, char *argv[])
+do_probe(int argc OVS_UNUSED, char *argv[])
{
struct ofpbuf *request;
struct vconn *vconn;
}
static void
-do_mod_port(int argc UNUSED, char *argv[])
+do_mod_port(int argc OVS_UNUSED, char *argv[])
{
struct ofpbuf *request, *reply;
struct ofp_switch_features *osf;
}
static void
-do_benchmark(int argc UNUSED, char *argv[])
+do_benchmark(int argc OVS_UNUSED, char *argv[])
{
size_t max_payload = 65535 - sizeof(struct ofp_header);
struct timeval start, end;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}
#! /bin/sh
-# Copyright (c) 2008, 2009 Nicira Networks, Inc.
+# Copyright (c) 2008, 2009, 2010 Nicira Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
}
fingerprint() {
- local file=$1
- local name=${1-$2}
- local date=$(date -r $file)
- local fingerprint
+ file=$1
+ name=${1-$2}
+ date=$(date -r $file)
if grep -q -e '-BEGIN CERTIFICATE-' "$file"; then
fingerprint=$(openssl x509 -noout -in "$file" -fingerprint |
sed 's/SHA1 Fingerprint=//' | tr -d ':')
}
glob() {
- local files=$(echo $1)
+ files=$(echo $1)
if test "$files" != "$1"; then
echo "$files"
fi
}
static void
-cmd_init(struct vsctl_context *ctx UNUSED)
+cmd_init(struct vsctl_context *ctx OVS_UNUSED)
{
}
-/* Copyright (c) 2008, 2009 Nicira Networks, Inc.
+/* Copyright (c) 2008, 2009, 2010 Nicira Networks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define DEFAULT_INTERVAL 1
#define DEFAULT_TIMEOUT 30
-int fd = -1;
+static int fd = -1;
/* The WDT is automatically enabled when /dev/watchdog is opened. If we
* do not send the magic value to the device first before exiting, the
{"help", no_argument, NULL, 'h'},
{"verbose", no_argument, NULL, 'v'},
{"version", no_argument, NULL, 'V'},
- {0, 0, 0, 0}
+ {NULL, 0, NULL, 0}
};
setup_signal();
}
static bool
-check_iface_netdev(struct bridge *br UNUSED, struct iface *iface,
- void *aux UNUSED)
+check_iface_netdev(struct bridge *br OVS_UNUSED, struct iface *iface,
+ void *aux OVS_UNUSED)
{
if (!iface->netdev) {
int error = set_up_iface(iface->cfg, iface, true);
}
static bool
-check_iface_dp_ifidx(struct bridge *br, struct iface *iface, void *aux UNUSED)
+check_iface_dp_ifidx(struct bridge *br, struct iface *iface,
+ void *aux OVS_UNUSED)
{
if (iface->dp_ifidx >= 0) {
VLOG_DBG("%s has interface %s on port %d",
}
static bool
-set_iface_properties(struct bridge *br UNUSED, struct iface *iface,
- void *aux UNUSED)
+set_iface_properties(struct bridge *br OVS_UNUSED, struct iface *iface,
+ void *aux OVS_UNUSED)
{
/* Set policing attributes. */
netdev_set_policing(iface->netdev,
/* Bridge unixctl user interface functions. */
static void
bridge_unixctl_fdb_show(struct unixctl_conn *conn,
- const char *args, void *aux UNUSED)
+ const char *args, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct bridge *br;
* stack, including those normally hidden. */
static void
bridge_unixctl_dump_flows(struct unixctl_conn *conn,
- const char *args, void *aux UNUSED)
+ const char *args, void *aux OVS_UNUSED)
{
struct bridge *br;
struct ds results;
return dst - dsts;
}
-static void UNUSED
+static void OVS_UNUSED
print_dsts(const struct dst *dsts, size_t n)
{
for (; n--; dsts++) {
static void
bond_unixctl_list(struct unixctl_conn *conn,
- const char *args UNUSED, void *aux UNUSED)
+ const char *args OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct bridge *br;
static void
bond_unixctl_show(struct unixctl_conn *conn,
- const char *args, void *aux UNUSED)
+ const char *args, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct port *port;
static void
bond_unixctl_migrate(struct unixctl_conn *conn, const char *args_,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
char *args = (char *) args_;
char *save_ptr = NULL;
static void
bond_unixctl_set_active_slave(struct unixctl_conn *conn, const char *args_,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
char *args = (char *) args_;
char *save_ptr = NULL;
static void
bond_unixctl_enable_slave(struct unixctl_conn *conn, const char *args,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
enable_slave(conn, args, true);
}
static void
bond_unixctl_disable_slave(struct unixctl_conn *conn, const char *args,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
enable_slave(conn, args, false);
}
static void
bond_unixctl_hash(struct unixctl_conn *conn, const char *args,
- void *aux UNUSED)
+ void *aux OVS_UNUSED)
{
uint8_t mac[ETH_ADDR_LEN];
uint8_t hash;
extra_ports = []
pifrec = db().get_pif_record(self._pif)
+ dprec = db().get_pif_record(self._dp)
ipdev = self._ipdev
bridge = pif_bridge_name(self._dp)
# XXX Needs support in ovs-vsctl
#if bridge == ipdev:
- # vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, pifrec['MAC'])]
+ # vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, dprec['MAC'])]
#else:
- # vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, pifrec['MAC'])]
+ # vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, dprec['MAC'])]
self._vsctl_argv = vsctl_argv
self._extra_ports = extra_ports