diff options
65 files changed, 287 insertions, 244 deletions
diff --git a/datapath/brc_procfs.c b/datapath/brc_procfs.c index ae4a4f50..cfe0175b 100644 --- a/datapath/brc_procfs.c +++ b/datapath/brc_procfs.c @@ -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) { diff --git a/datapath/datapath.c b/datapath/datapath.c index 46bb6961..1e878ebe 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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); diff --git a/extras/ezio/ovs-switchui.c b/extras/ezio/ovs-switchui.c index 4f0843f3..79f5552d 100644 --- a/extras/ezio/ovs-switchui.c +++ b/extras/ezio/ovs-switchui.c @@ -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"; diff --git a/extras/ezio/terminal.c b/extras/ezio/terminal.c index e41a987d..090e80e4 100644 --- a/extras/ezio/terminal.c +++ b/extras/ezio/terminal.c @@ -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); } diff --git a/extras/ezio/tty.c b/extras/ezio/tty.c index 9b05480a..43288285 100644 --- a/extras/ezio/tty.c +++ b/extras/ezio/tty.c @@ -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; diff --git a/lib/backtrace.c b/lib/backtrace.c index 2f478093..80cae54a 100644 --- a/lib/backtrace.c +++ b/lib/backtrace.c @@ -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"; diff --git a/lib/command-line.c b/lib/command-line.c index 2f997984..17344c36 100644 --- a/lib/command-line.c +++ b/lib/command-line.c @@ -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, ...) { } diff --git a/lib/compiler.h b/lib/compiler.h index 216dd6af..6c0db0fe 100644 --- a/lib/compiler.h +++ b/lib/compiler.h @@ -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))) diff --git a/lib/coverage.c b/lib/coverage.c index 8b5e9d9c..5c99c18a 100644 --- a/lib/coverage.c +++ b/lib/coverage.c @@ -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; diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index fb6835c1..30ac56c9 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -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. */ } @@ -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; diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index ddf9298e..4c343256 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -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; diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 042837c1..1dee14b4 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -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) { diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c index 60a188e6..80ecfc35 100644 --- a/lib/fatal-signal.c +++ b/lib/fatal-signal.c @@ -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; diff --git a/lib/leak-checker.c b/lib/leak-checker.c index 8d256bc8..4ab55e59 100644 --- a/lib/leak-checker.c +++ b/lib/leak-checker.c @@ -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. @@ -24,19 +24,19 @@ #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; diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 78346acb..074a056e 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -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); diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 6d46b09e..5341ed06 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -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, diff --git a/lib/netdev.c b/lib/netdev.c index 78d6a924..2c7b260e 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -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) { diff --git a/lib/netdev.h b/lib/netdev.h index e3a31769..27eb82e5 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -21,6 +21,10 @@ #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 */ diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 9c1afe44..e2271299 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -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", diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index d1407e76..bb216791 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -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' diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index 06083ae3..259e703c 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -19,6 +19,10 @@ #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 */ diff --git a/lib/packets.h b/lib/packets.h index 6513f64b..eaffca93 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -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]) diff --git a/lib/process.c b/lib/process.c index 3504dfb0..39168862 100644 --- a/lib/process.c +++ b/lib/process.c @@ -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, } static void -sigchld_handler(int signr UNUSED) +sigchld_handler(int signr OVS_UNUSED) { struct process *p; diff --git a/lib/queue.c b/lib/queue.c index 649db3be..d204a469 100644 --- a/lib/queue.c +++ b/lib/queue.c @@ -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; diff --git a/lib/rconn.c b/lib/rconn.c index f2d074aa..6bd43940 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -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); } diff --git a/lib/shash.h b/lib/shash.h index 52cd4dca..3a6e2778 100644 --- a/lib/shash.h +++ b/lib/shash.h @@ -19,6 +19,10 @@ #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 */ diff --git a/lib/socket-util.c b/lib/socket-util.c index d2ee8ea4..a8f805c5 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -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; diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index 941f7791..51ce3063 100644 --- a/lib/stream-ssl.c +++ b/lib/stream-ssl.c @@ -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; diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c index e690e9c5..a9bcaeb4 100644 --- a/lib/stream-tcp.c +++ b/lib/stream-tcp.c @@ -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]; diff --git a/lib/stream-unix.c b/lib/stream-unix.c index 6ce7790b..33f566b3 100644 --- a/lib/stream-unix.c +++ b/lib/stream-unix.c @@ -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; diff --git a/lib/stream.c b/lib/stream.c index dcd8da58..db6ec61b 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -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 diff --git a/lib/timeval.h b/lib/timeval.h index 5ba903e3..89abe803 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -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. @@ -21,6 +21,10 @@ #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 */ diff --git a/lib/unixctl.c b/lib/unixctl.c index e648cc86..f710ffd6 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -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; @@ -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) { } @@ -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 } diff --git a/lib/vconn-stream.c b/lib/vconn-stream.c index 594eded5..99eb21a8 100644 --- a/lib/vconn-stream.c +++ b/lib/vconn-stream.c @@ -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; diff --git a/lib/vconn.c b/lib/vconn.c index 1445be48..c77b6524 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -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 @@ -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(); diff --git a/ofproto/discovery.c b/ofproto/discovery.c index ce3e7ce5..ae36b4dc 100644 --- a/ofproto/discovery.c +++ b/ofproto/discovery.c @@ -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"); } diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 44c94a12..45372003 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -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_; diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index b5f6f58e..7ab9dee6 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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) { diff --git a/ovsdb/execution.c b/ovsdb/execution.c index 3e3d3563..b984b1b5 100644 --- a/ovsdb/execution.c +++ b/ovsdb/execution.c @@ -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; diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c index 26fabe52..e3984647 100644 --- a/ovsdb/jsonrpc-server.c +++ b/ovsdb/jsonrpc-server.c @@ -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; diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index df24e371..acc41854 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -576,7 +576,7 @@ table_print(const struct table *table) } 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(); } diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index a0f4a56d..9a90679e 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -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} diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 03ebba17..eccbf7d1 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -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_; diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index 1f2a5ef7..34c76761 100644 --- a/ovsdb/ovsdb-tool.c +++ b/ovsdb/ovsdb-tool.c @@ -150,7 +150,7 @@ check_ovsdb_error(struct ovsdb_error *error) } 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(); } diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 2dea507c..2b5bdc32 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -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); diff --git a/tests/test-dhcp-client.c b/tests/test-dhcp-client.c index 3b35dac6..79d17736 100644 --- a/tests/test-dhcp-client.c +++ b/tests/test-dhcp-client.c @@ -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); diff --git a/tests/test-flows.c b/tests/test-flows.c index 6e0b7736..451ca1ad 100644 --- a/tests/test-flows.c +++ b/tests/test-flows.c @@ -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; diff --git a/tests/test-hmap.c b/tests/test-hmap.c index cf6ee1c9..18d8f461 100644 --- a/tests/test-hmap.c +++ b/tests/test-hmap.c @@ -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; } diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c index 03d30001..06b1cf47 100644 --- a/tests/test-jsonrpc.c +++ b/tests/test-jsonrpc.c @@ -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(); } diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c index 3025ce39..2e12d495 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -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; diff --git a/tests/test-reconnect.c b/tests/test-reconnect.c index 8441fadd..93991ff5 100644 --- a/tests/test-reconnect.c +++ b/tests/test-reconnect.c @@ -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])); } diff --git a/tests/test-vconn.c b/tests/test-vconn.c index f12e378f..a394f6cf 100644 --- a/tests/test-vconn.c +++ b/tests/test-vconn.c @@ -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(); diff --git a/utilities/nlmon.c b/utilities/nlmon.c index 1da026b0..d5e743f7 100644 --- a/utilities/nlmon.c +++ b/utilities/nlmon.c @@ -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; diff --git a/utilities/ovs-discover.c b/utilities/ovs-discover.c index 0b7d92d6..3830e073 100644 --- a/utilities/ovs-discover.c +++ b/utilities/ovs-discover.c @@ -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; diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index ebcf2e23..eb78a573 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -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(); } diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 7f24309b..2a171533 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -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(); } diff --git a/utilities/ovs-pki.in b/utilities/ovs-pki.in index 39d5782e..ea959fdd 100755 --- a/utilities/ovs-pki.in +++ b/utilities/ovs-pki.in @@ -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 diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 498a0b0b..84db728b 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -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) { } diff --git a/utilities/ovs-wdt.c b/utilities/ovs-wdt.c index fc3efb19..fedc65c3 100644 --- a/utilities/ovs-wdt.c +++ b/utilities/ovs-wdt.c @@ -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(); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index f097e183..c2e89eb8 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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; diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index 6e5deb7e..59bce6f5 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -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 |