Merge "master" into "next".
authorBen Pfaff <blp@nicira.com>
Thu, 11 Feb 2010 19:11:23 +0000 (11:11 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 11 Feb 2010 19:11:23 +0000 (11:11 -0800)
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".

65 files changed:
datapath/brc_procfs.c
datapath/datapath.c
extras/ezio/ovs-switchui.c
extras/ezio/terminal.c
extras/ezio/tty.c
lib/backtrace.c
lib/command-line.c
lib/compiler.h
lib/coverage.c
lib/dhcp-client.c
lib/dhcp.c
lib/dpif-linux.c
lib/dpif-netdev.c
lib/fatal-signal.c
lib/leak-checker.c
lib/learning-switch.c
lib/netdev-linux.c
lib/netdev.c
lib/netdev.h
lib/ofp-print.c
lib/ofpbuf.c
lib/ofpbuf.h
lib/packets.h
lib/process.c
lib/queue.c
lib/rconn.c
lib/shash.h
lib/socket-util.c
lib/stream-ssl.c
lib/stream-tcp.c
lib/stream-unix.c
lib/stream.c
lib/timeval.h
lib/unixctl.c
lib/util.c
lib/util.h
lib/vconn-stream.c
lib/vconn.c
lib/vlog.c
ofproto/discovery.c
ofproto/ofproto-sflow.c
ofproto/ofproto.c
ovsdb/execution.c
ovsdb/jsonrpc-server.c
ovsdb/ovsdb-client.c
ovsdb/ovsdb-idlc.in
ovsdb/ovsdb-server.c
ovsdb/ovsdb-tool.c
ovsdb/ovsdb.c
tests/test-dhcp-client.c
tests/test-flows.c
tests/test-hmap.c
tests/test-jsonrpc.c
tests/test-ovsdb.c
tests/test-reconnect.c
tests/test-vconn.c
utilities/nlmon.c
utilities/ovs-discover.c
utilities/ovs-dpctl.c
utilities/ovs-ofctl.c
utilities/ovs-pki.in
utilities/ovs-vsctl.c
utilities/ovs-wdt.c
vswitchd/bridge.c
xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py

index ae4a4f5..cfe0175 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -12,6 +12,7 @@
 #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
@@ -49,7 +50,7 @@ static struct file_operations brc_fops = {
 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) {
index 46bb696..1e878eb 100644 (file)
@@ -81,7 +81,7 @@ struct datapath *get_dp(int dp_idx)
 }
 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;
 
@@ -176,7 +176,7 @@ static void release_dp(struct kobject *kobj)
        kfree(dp);
 }
 
-struct kobj_type dp_ktype = {
+static struct kobj_type dp_ktype = {
        .release = release_dp
 };
 
@@ -325,7 +325,7 @@ static void release_nbp(struct kobject *kobj)
        kfree(p);
 }
 
-struct kobj_type brport_ktype = {
+static struct kobj_type brport_ktype = {
 #ifdef CONFIG_SYSFS
        .sysfs_ops = &brport_sysfs_ops,
 #endif
@@ -423,7 +423,7 @@ got_port_no:
        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);
index 4f0843f..79f5552 100644 (file)
@@ -996,7 +996,7 @@ initialize_terminal(void)
 }
 
 static void
-restore_terminal(void *aux UNUSED)
+restore_terminal(void *aux OVS_UNUSED)
 {
     endwin();
 }
@@ -1445,7 +1445,7 @@ init_reboot_notifier(void)
 }
 
 static void
-sigusr1_handler(int signr UNUSED)
+sigusr1_handler(int signr OVS_UNUSED)
 {
     sigusr1_triggered = true;
 }
@@ -1875,7 +1875,7 @@ yesno(const char *title, bool def)
 }
 
 static void
-cmd_show_version(const struct dict *dict UNUSED)
+cmd_show_version(const struct dict *dict OVS_UNUSED)
 {
     show_string(VERSION BUILDNR);
 }
@@ -1896,7 +1896,7 @@ cmd_browse_status(const struct dict *dict)
 }
 
 static void
-cmd_shell(const struct dict *dict UNUSED)
+cmd_shell(const struct dict *dict OVS_UNUSED)
 {
     const char *home;
 
@@ -1920,7 +1920,7 @@ cmd_shell(const struct dict *dict UNUSED)
 }
 
 static void
-cmd_show_motto(const struct dict *dict UNUSED)
+cmd_show_motto(const struct dict *dict OVS_UNUSED)
 {
     show_string("\"Just Add Ice\"");
 }
@@ -2548,7 +2548,7 @@ disconnected_string(int value)
 }
 
 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;
@@ -2890,7 +2890,7 @@ cmd_configure(const struct dict *dict UNUSED)
 }
 
 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";
index e41a987..090e80e 100644 (file)
@@ -1,4 +1,4 @@
-/* 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.
@@ -97,7 +97,7 @@ terminal_run(struct terminal *term, struct ezio *ezio, int input_fd)
 }
 
 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);
 }
index 9b05480..4328828 100644 (file)
@@ -374,7 +374,9 @@ tty_fork_child(int master_fd, char *argv[])
 }
 
 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;
index 2f47809..80cae54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -25,7 +25,7 @@
 #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";
index 2f99798..17344c3 100644 (file)
@@ -180,12 +180,12 @@ proctitle_restore(void)
 /* 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, ...)
 {
 }
 
index 216dd6a..6c0db0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -18,7 +18,7 @@
 #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)))
index 8b5e9d9..5c99c18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -30,8 +30,8 @@
 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);
@@ -109,7 +109,7 @@ coverage_hit(uint32_t hash)
     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;
index fb6835c..30ac56c 100644 (file)
@@ -775,7 +775,7 @@ dhclient_run_REBINDING(struct dhclient *cli)
 }
 
 static void
-dhclient_run_RELEASED(struct dhclient *cli UNUSED)
+dhclient_run_RELEASED(struct dhclient *cli OVS_UNUSED)
 {
     /* Nothing to do. */
 }
index 51d6ed0..e16176b 100644 (file)
@@ -674,7 +674,7 @@ dhcp_parse(struct dhcp_msg *msg, const struct ofpbuf *b_)
     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;
index ddf9298..4c34325 100644 (file)
@@ -107,7 +107,7 @@ dpif_linux_enumerate(struct svec *all_dps)
 }
 
 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;
index 042837c..1dee14b 100644 (file)
@@ -245,7 +245,7 @@ create_dp_netdev(const char *name, int dp_idx, struct dpif **dpifp)
 }
 
 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) {
@@ -582,7 +582,7 @@ dpif_netdev_port_list(const struct dpif *dpif, struct odp_port *ports, int n)
 }
 
 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) {
index 60a188e..80ecfc3 100644 (file)
@@ -234,13 +234,13 @@ fatal_signal_unlink_file_now(const char *file)
 }
 
 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;
index 8d256bc..4ab55e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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)
 {
 }
 
@@ -180,7 +180,7 @@ reset_hooks(void)
 }
 
 static void *
-hook_malloc(size_t size, const void *caller UNUSED)
+hook_malloc(size_t size, const void *caller OVS_UNUSED)
 {
     void *p;
 
@@ -209,7 +209,7 @@ leak_checker_claim(const void *p)
 }
 
 static void
-hook_free(void *p, const void *caller UNUSED)
+hook_free(void *p, const void *caller OVS_UNUSED)
 {
     if (!p) {
         return;
@@ -225,7 +225,7 @@ hook_free(void *p, const void *caller UNUSED)
 }
 
 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;
 
index 78346ac..074a056 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -517,7 +517,8 @@ process_port_status(struct lswitch *sw, struct rconn *rconn, void *ops_)
 }
 
 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);
index 6d46b09..5341ed0 100644 (file)
@@ -216,7 +216,7 @@ netdev_linux_wait(void)
 
 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) {
@@ -242,8 +242,8 @@ netdev_linux_cache_cb(const struct rtnetlink_change *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;
@@ -397,7 +397,7 @@ setup_gre_ioctl(const char *name, struct gre_config *config, bool create)
 /* 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;
@@ -569,7 +569,7 @@ error:
 
 /* 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;
@@ -602,7 +602,7 @@ netdev_linux_create_system(const char *name, const char *type UNUSED,
  * 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;
@@ -669,7 +669,7 @@ if_up(const char *name)
 }
 
 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;
@@ -708,7 +708,7 @@ netdev_linux_reconfigure_gre(struct netdev_dev *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;
@@ -1707,7 +1707,7 @@ do_set_addr(struct netdev *netdev,
 
 /* 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;
@@ -1874,7 +1874,7 @@ poll_notify(struct list *list)
 
 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,
index 78d6a92..2c7b260 100644 (file)
@@ -59,7 +59,7 @@ static struct list netdev_list = LIST_INITIALIZER(&netdev_list);
  * 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);
 
@@ -1265,7 +1265,7 @@ restore_flags(struct netdev *netdev)
 /* 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) {
index e3a3176..27eb82e 100644 (file)
 #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
@@ -155,4 +159,8 @@ void netdev_monitor_remove(struct netdev_monitor *, struct netdev *);
 int netdev_monitor_poll(struct netdev_monitor *, char **devnamep);
 void netdev_monitor_poll_wait(const struct netdev_monitor *);
 
+#ifdef  __cplusplus
+}
+#endif
+
 #endif /* netdev.h */
index 9c1afe4..e227129 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -47,7 +47,7 @@ static void ofp_print_port_name(struct ds *string, uint16_t port);
  *
  * 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;
@@ -535,7 +535,7 @@ ofp_print_phy_port(struct ds *string, const struct ofp_phy_port *port)
  * '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;
@@ -565,8 +565,8 @@ ofp_print_switch_features(struct ds *string, const void *oh, size_t len,
 /* 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;
@@ -739,8 +739,8 @@ ofp_print_flow_mod(struct ds *string, const void *oh, size_t len,
 /* 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;
 
@@ -765,8 +765,8 @@ ofp_print_flow_expired(struct ds *string, const void *oh, size_t len UNUSED,
 }
 
 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;
 
@@ -852,7 +852,7 @@ lookup_error_code(int type, int code)
  * 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);
@@ -883,8 +883,8 @@ ofp_print_error_msg(struct ds *string, const void *oh, size_t len,
 /* 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;
 
@@ -900,8 +900,8 @@ ofp_print_port_status(struct ds *string, const void *oh, size_t len UNUSED,
 }
 
 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;
 
@@ -912,8 +912,8 @@ ofp_desc_stats_reply(struct ds *string, const void *body, size_t len UNUSED,
 }
 
 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;
 
@@ -990,7 +990,7 @@ ofp_flow_stats_reply(struct ds *string, const void *body_, size_t len,
 
 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;
 
@@ -1005,7 +1005,7 @@ ofp_aggregate_stats_request(struct ds *string, const void *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_;
 
@@ -1092,7 +1092,7 @@ ofp_table_stats_reply(struct ds *string, const void *body, size_t len,
 
 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",
index d1407e7..bb21679 100644 (file)
@@ -36,7 +36,7 @@ ofpbuf_use(struct ofpbuf *b, void *base, size_t allocated)
     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'
index 06083ae..259e703 100644 (file)
 
 #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 {
@@ -34,7 +38,7 @@ 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);
@@ -70,4 +74,8 @@ void ofpbuf_clear(struct ofpbuf *);
 void *ofpbuf_pull(struct ofpbuf *, size_t);
 void *ofpbuf_try_pull(struct ofpbuf *, size_t);
 
+#ifdef  __cplusplus
+}
+#endif
+
 #endif /* ofpbuf.h */
index 6513f64..eaffca9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -30,7 +30,7 @@ bool dpid_from_string(const char *s, uint64_t *dpidp);
 
 #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])
index 3504dfb..3916886 100644 (file)
@@ -55,7 +55,7 @@ static struct list all_processes = LIST_INITIALIZER(&all_processes);
 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
@@ -585,7 +585,7 @@ process_run_capture(char **argv, char **stdout_log, char **stderr_log,
 }
 \f
 static void
-sigchld_handler(int signr UNUSED)
+sigchld_handler(int signr OVS_UNUSED)
 {
     struct process *p;
 
index 649db3b..d204a46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -100,7 +100,7 @@ queue_pop_head(struct ovs_queue *q)
 
 /* 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;
index f2d074a..6bd4394 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -313,13 +313,13 @@ rconn_destroy(struct rconn *rc)
 }
 
 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. */
 }
@@ -566,7 +566,7 @@ rconn_send(struct rconn *rc, struct ofpbuf *b,
     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);
         }
@@ -864,7 +864,7 @@ try_send(struct rconn *rc)
 {
     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) {
@@ -933,7 +933,7 @@ flush_queue(struct rconn *rc)
     }
     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);
         }
index 52cd4dc..3a6e277 100644 (file)
 
 #include "hmap.h"
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 struct shash_node {
     struct hmap_node node;
     char *name;
@@ -55,4 +59,8 @@ struct shash_node *shash_first(const struct shash *);
 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 */
index d2ee8ea..a8f805c 100644 (file)
@@ -204,7 +204,7 @@ make_sockaddr_un(const char *name, struct sockaddr_un* un, socklen_t *un_len)
  *
  * 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;
index 941f779..51ce306 100644 (file)
@@ -155,7 +155,7 @@ static void ssl_close(struct stream *);
 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
@@ -719,7 +719,7 @@ pssl_pstream_cast(struct pstream *pstream)
 }
 
 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;
@@ -855,7 +855,7 @@ do_ssl_init(void)
 }
 
 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;
index e690e9c..a9bcaeb 100644 (file)
@@ -101,7 +101,7 @@ static int ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
                        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];
index 6ce7790..33f566b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -80,7 +80,8 @@ static int punix_accept(int fd, const struct sockaddr *sa, size_t sa_len,
                         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;
 
index dcd8da5..db6ec61 100644 (file)
@@ -102,7 +102,7 @@ check_stream_classes(void)
  * 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
index 5ba903e..89abe80 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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;
 
@@ -53,4 +57,8 @@ int time_poll(struct pollfd *, int n_pollfds, int timeout);
 
 long long int timeval_to_msec(const struct timeval *);
 
+#ifdef  __cplusplus
+}
+#endif
+
 #endif /* timeval.h */
index e648cc8..f710ffd 100644 (file)
@@ -77,8 +77,8 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
 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;
index e928480..8f1892e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -388,4 +388,4 @@ dir_name(const char *file_name)
  * __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) { }
index 0101bf7..562f7e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -127,7 +127,7 @@ int hexit_value(int c);
 
 char *dir_name(const char *file_name);
 
-void ignore(bool x UNUSED);
+void ignore(bool x OVS_UNUSED);
 
 #ifdef  __cplusplus
 }
index 594eded..99eb21a 100644 (file)
@@ -72,7 +72,7 @@ vconn_stream_new(struct stream *stream, int connect_status)
  *
  * 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;
@@ -298,7 +298,7 @@ pvconn_pstream_cast(struct pvconn *pvconn)
  * 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;
index 1445be4..c77b652 100644 (file)
@@ -120,7 +120,7 @@ check_vconn_classes(void)
  * 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
index b2d0c06..b534d19 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -385,7 +385,8 @@ vlog_set_verbosity(const char *arg)
 }
 
 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);
@@ -394,7 +395,7 @@ vlog_unixctl_set(struct unixctl_conn *conn, const char *args, void *aux UNUSED)
 
 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);
@@ -403,7 +404,7 @@ vlog_unixctl_list(struct unixctl_conn *conn,
 
 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();
index ce3e7ce..ae36b4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -244,7 +244,7 @@ discovery_wait(struct discovery *d)
 }
 
 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");
 }
index 44c94a1..4537200 100644 (file)
@@ -96,14 +96,16 @@ ofproto_sflow_options_destroy(struct ofproto_sflow_options *options)
 
 /* 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;
@@ -111,15 +113,16 @@ sflow_agent_free_cb(void *magic UNUSED, SFLAgent *agent UNUSED, void *obj)
 
 /* 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_;
index b5f6f58..7ab9dee 100644 (file)
@@ -600,7 +600,7 @@ ofproto_set_rate_limit(struct ofproto *ofproto,
 }
 
 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) {
index 3e3d356..b984b1b 100644 (file)
@@ -204,7 +204,7 @@ exit:
 
 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;
 
@@ -216,9 +216,9 @@ ovsdb_execute_commit(struct ovsdb_execution *x, struct ovsdb_parser *parser,
 }
 
 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");
 }
@@ -579,7 +579,7 @@ ovsdb_execute_wait_query_cb(const struct ovsdb_row *row, void *aux_)
 
 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;
@@ -692,7 +692,7 @@ ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser,
 
 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;
 
index 26fabe5..e398464 100644 (file)
@@ -915,7 +915,8 @@ ovsdb_jsonrpc_monitor_init_aux(struct ovsdb_jsonrpc_monitor_aux *aux,
 
 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;
index df24e37..acc4185 100644 (file)
@@ -576,7 +576,7 @@ table_print(const struct table *table)
 }
 \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;
@@ -607,7 +607,7 @@ do_list_dbs(int argc UNUSED, char *argv[])
 }
 
 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));
@@ -615,7 +615,7 @@ do_get_schema(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -639,7 +639,7 @@ do_list_tables(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -683,7 +683,7 @@ do_list_columns(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -909,7 +909,7 @@ do_monitor(int argc, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
index a0f4a56..9a90679 100755 (executable)
@@ -444,7 +444,7 @@ def printCIDLSource(schemaFile):
 
 static bool inited;
 
-static void UNUSED
+static void OVS_UNUSED
 do_set_regex(struct ovsdb_base_type *base, const char *reMatch,
              const char *reComment)
 {
@@ -585,7 +585,7 @@ static void
             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}
index 03ebba1..eccbf7d 100644 (file)
@@ -192,7 +192,7 @@ set_remotes(struct ovsdb_jsonrpc_server *jsonrpc,
 
 
 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_;
index 1f2a5ef..34c7676 100644 (file)
@@ -150,7 +150,7 @@ check_ovsdb_error(struct ovsdb_error *error)
 }
 \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];
@@ -190,13 +190,13 @@ transact(bool read_only, const char *db_file_name, const char *transaction)
 }
 
 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]);
 }
@@ -281,7 +281,7 @@ print_db_changes(struct shash *tables, struct shash *names)
 }
 
 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;
@@ -329,7 +329,7 @@ do_show_log(int argc UNUSED, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
index 2dea507..2b5bdc3 100644 (file)
@@ -287,7 +287,7 @@ ovsdb_add_replica(struct ovsdb *db, struct ovsdb_replica *r)
 }
 
 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);
index 3b35dac..79d1773 100644 (file)
@@ -91,7 +91,7 @@ release(void *cli_)
 }
 
 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);
index 6e0b773..451ca1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -31,7 +31,7 @@
 #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;
index cf6ee1c..18d8f46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -157,7 +157,7 @@ good_hash(int value)
 }
 
 static size_t
-constant_hash(int value UNUSED)
+constant_hash(int value OVS_UNUSED)
 {
     return 123;
 }
index 03d3000..06b1cf4 100644 (file)
@@ -175,7 +175,7 @@ handle_rpc(struct jsonrpc *rpc, struct jsonrpc_msg *msg, bool *done)
 }
 
 static void
-do_listen(int argc UNUSED, char *argv[])
+do_listen(int argc OVS_UNUSED, char *argv[])
 {
     struct pstream *pstream;
     struct jsonrpc **rpcs;
@@ -256,7 +256,7 @@ do_listen(int argc UNUSED, char *argv[])
 }
 
 static void
-do_request(int argc UNUSED, char *argv[])
+do_request(int argc OVS_UNUSED, char *argv[])
 {
     struct jsonrpc_msg *msg;
     struct jsonrpc *rpc;
@@ -295,7 +295,7 @@ do_request(int argc UNUSED, char *argv[])
 }
 
 static void
-do_notify(int argc UNUSED, char *argv[])
+do_notify(int argc OVS_UNUSED, char *argv[])
 {
     struct jsonrpc_msg *msg;
     struct jsonrpc *rpc;
@@ -327,7 +327,7 @@ do_notify(int argc UNUSED, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
index 3025ce3..2e12d49 100644 (file)
@@ -325,7 +325,7 @@ do_log_io(int argc, char *argv[])
 }
 
 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;
@@ -337,7 +337,7 @@ do_parse_atomic_type(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -350,7 +350,7 @@ do_parse_base_type(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -482,7 +482,7 @@ compare_atoms(const void *a_, const void *b_)
 }
 
 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;
@@ -524,7 +524,7 @@ do_sort_atoms(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -537,7 +537,7 @@ do_parse_column(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -705,7 +705,7 @@ do_parse_conditions(int argc, char *argv[])
 }
 
 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;
@@ -810,7 +810,7 @@ do_parse_mutations(int argc, char *argv[])
 }
 
 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;
@@ -926,7 +926,7 @@ do_query_cb(const struct ovsdb_row *row, void *cbdata_)
 }
 
 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;
@@ -1016,7 +1016,7 @@ struct do_query_distinct_row {
 };
 
 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;
@@ -1141,7 +1141,7 @@ do_query_distinct(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -1154,7 +1154,7 @@ do_parse_schema(int argc UNUSED, char *argv[])
 }
 
 static void
-do_execute(int argc UNUSED, char *argv[])
+do_execute(int argc OVS_UNUSED, char *argv[])
 {
     struct ovsdb_schema *schema;
     struct json *json;
@@ -1204,7 +1204,7 @@ do_trigger_dump(struct test_trigger *t, long long int now, const char *title)
 }
 
 static void
-do_trigger(int argc UNUSED, char *argv[])
+do_trigger(int argc OVS_UNUSED, char *argv[])
 {
     struct ovsdb_schema *schema;
     struct list completions;
@@ -1259,7 +1259,7 @@ do_trigger(int argc UNUSED, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
@@ -1271,14 +1271,14 @@ static struct ovsdb_txn *do_transact_txn;
 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;
@@ -1338,7 +1338,7 @@ do_transact_set_i_j(struct ovsdb_row *row,
 }
 
 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;
@@ -1360,14 +1360,14 @@ do_transact_insert(int argc UNUSED, char *argv[] UNUSED)
 }
 
 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;
@@ -1387,7 +1387,7 @@ compare_rows_by_uuid(const void *a_, const void *b_)
 }
 
 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;
index 8441fad..93991ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -86,19 +86,19 @@ main(void)
 }
 
 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);
 }
@@ -118,31 +118,31 @@ error_from_string(const char *s)
 }
 
 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);
 }
@@ -179,13 +179,13 @@ do_run(int argc, char *argv[])
 }
 
 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) {
@@ -197,7 +197,7 @@ do_timeout(int argc UNUSED, char *argv[] UNUSED)
 }
 
 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]));
 }
index f12e378..a394f6c 100644 (file)
@@ -134,7 +134,7 @@ fpv_destroy(struct fake_pvconn *fpv)
 /* 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;
@@ -156,7 +156,7 @@ test_refuse_connection(int argc UNUSED, char *argv[])
  * 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;
@@ -181,7 +181,7 @@ test_accept_then_close(int argc UNUSED, char *argv[])
  * 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;
@@ -310,7 +310,7 @@ test_send_hello(const char *type, const void *out, size_t out_size,
 
 /* 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;
@@ -326,7 +326,7 @@ test_send_plain_hello(int argc UNUSED, char *argv[])
  * 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;
@@ -344,7 +344,7 @@ test_send_long_hello(int argc UNUSED, char *argv[])
 /* 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;
@@ -359,7 +359,7 @@ test_send_echo_hello(int argc UNUSED, char *argv[])
 /* 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;
@@ -371,7 +371,7 @@ test_send_short_hello(int argc UNUSED, char *argv[])
 /* 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;
@@ -396,7 +396,7 @@ static const struct command commands[] = {
 };
 
 int
-main(int argc, char *argv[])
+main(int argc OVS_UNUSED, char *argv[])
 {
     set_program_name(argv[0]);
     time_init();
index 1da026b..d5e743f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -36,7 +36,7 @@ static const struct nl_policy rtnlgrp_link_policy[] = {
 };
 
 int
-main(int argc UNUSED, char *argv[])
+main(int argc OVS_UNUSED, char *argv[])
 {
     struct nl_sock *sock;
     int error;
index 0b7d92d..3830e07 100644 (file)
@@ -60,7 +60,7 @@ static bool exit_without_bind;
 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;
@@ -238,7 +238,7 @@ iface_init(struct iface *iface, const char *netdev_name)
 }
 
 static void
-release_ifaces(void *aux UNUSED)
+release_ifaces(void *aux OVS_UNUSED)
 {
     int i;
 
@@ -252,13 +252,13 @@ release_ifaces(void *aux UNUSED)
 }
 
 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;
index ebcf2e2..eb78a57 100644 (file)
@@ -196,7 +196,7 @@ parsed_dpif_open(const char *arg_, bool create, struct dpif **dpifp)
 }
 
 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");
@@ -207,7 +207,7 @@ do_add_dp(int argc UNUSED, char *argv[])
 }
 
 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");
@@ -231,7 +231,7 @@ query_ports(struct dpif *dpif, struct odp_port **ports, size_t *n_ports)
 }
 
 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;
@@ -309,7 +309,7 @@ get_port_number(struct dpif *dpif, const char *name, uint16_t *port)
 }
 
 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;
@@ -418,7 +418,7 @@ do_show(int argc, char *argv[])
 }
 
 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;
@@ -454,7 +454,7 @@ do_dump_dps(int argc UNUSED, char *argv[] UNUSED)
 }
 
 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;
@@ -484,7 +484,7 @@ do_dump_flows(int argc UNUSED, char *argv[])
 }
 
 static void
-do_del_flows(int argc UNUSED, char *argv[])
+do_del_flows(int argc OVS_UNUSED, char *argv[])
 {
     struct dpif *dpif;
 
@@ -494,7 +494,7 @@ do_del_flows(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -521,7 +521,7 @@ do_dump_groups(int argc UNUSED, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
index 7f24309..2a17153 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -339,7 +339,7 @@ dump_trivial_stats_transaction(const char *vconn_name, uint8_t stats_type)
 }
 
 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);
@@ -378,13 +378,13 @@ do_status(int argc, char *argv[])
 }
 
 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);
 }
@@ -812,7 +812,7 @@ do_dump_aggregate(int argc, char *argv[])
 }
 
 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;
@@ -840,7 +840,7 @@ do_add_flow(int argc UNUSED, char *argv[])
 }
 
 static void
-do_add_flows(int argc UNUSED, char *argv[])
+do_add_flows(int argc OVS_UNUSED, char *argv[])
 {
     struct vconn *vconn;
     FILE *file;
@@ -893,7 +893,7 @@ do_add_flows(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -954,7 +954,7 @@ static void do_del_flows(int argc, char *argv[])
 }
 
 static void
-do_monitor(int argc UNUSED, char *argv[])
+do_monitor(int argc OVS_UNUSED, char *argv[])
 {
     struct vconn *vconn;
 
@@ -979,13 +979,13 @@ do_monitor(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -1002,7 +1002,7 @@ do_probe(int argc UNUSED, char *argv[])
 }
 
 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;
@@ -1129,7 +1129,7 @@ do_ping(int argc, char *argv[])
 }
 
 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;
@@ -1172,7 +1172,7 @@ do_benchmark(int argc UNUSED, char *argv[])
 }
 
 static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
 {
     usage();
 }
index 39d5782..ea959fd 100755 (executable)
@@ -1,6 +1,6 @@
 #! /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.
@@ -348,10 +348,9 @@ make_tmpdir() {
 }
 
 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 ':')
@@ -472,7 +471,7 @@ sign_request() {
 }
 
 glob() {
-    local files=$(echo $1)
+    files=$(echo $1)
     if test "$files" != "$1"; then
         echo "$files"
     fi
index 498a0b0..84db728 100644 (file)
@@ -824,7 +824,7 @@ ovs_delete_bridge(const struct ovsrec_open_vswitch *ovs,
 }
 
 static void
-cmd_init(struct vsctl_context *ctx UNUSED)
+cmd_init(struct vsctl_context *ctx OVS_UNUSED)
 {
 }
 
index fc3efb1..fedc65c 100644 (file)
@@ -1,4 +1,4 @@
-/* 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.
@@ -30,7 +30,7 @@
 #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 
@@ -134,7 +134,7 @@ int main(int argc, char *argv[])
         {"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();
index f097e18..c2e89eb 100644 (file)
@@ -452,8 +452,8 @@ reconfigure_iface(const struct ovsrec_interface *iface_cfg, struct iface *iface)
 }
 
 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);
@@ -468,7 +468,8 @@ check_iface_netdev(struct bridge *br UNUSED, struct iface *iface,
 }
 
 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",
@@ -483,8 +484,8 @@ check_iface_dp_ifidx(struct bridge *br, struct iface *iface, void *aux UNUSED)
 }
 
 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,
@@ -1099,7 +1100,7 @@ bridge_get_local_iface(struct bridge *br)
 /* 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;
@@ -1227,7 +1228,7 @@ bridge_get_datapathid(const char *name)
  * 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;
@@ -1994,7 +1995,7 @@ compose_dsts(const struct bridge *br, const flow_t *flow, uint16_t vlan,
     return dst - dsts;
 }
 
-static void UNUSED
+static void OVS_UNUSED
 print_dsts(const struct dst *dsts, size_t n)
 {
     for (; n--; dsts++) {
@@ -2709,7 +2710,7 @@ bond_send_learning_packets(struct port *port)
 
 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;
@@ -2760,7 +2761,7 @@ bond_find(const char *name)
 
 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;
@@ -2826,7 +2827,7 @@ bond_unixctl_show(struct unixctl_conn *conn,
 
 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;
@@ -2883,7 +2884,7 @@ bond_unixctl_migrate(struct unixctl_conn *conn, const char *args_,
 
 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;
@@ -2964,21 +2965,21 @@ enable_slave(struct unixctl_conn *conn, const char *args_, bool enable)
 
 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;
index 6e5deb7..59bce6f 100644 (file)
@@ -330,6 +330,7 @@ class DatapathVswitch(Datapath):
         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)
@@ -366,9 +367,9 @@ class DatapathVswitch(Datapath):
 
         # 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