struct list is a common name and can't be used in public headers.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
/* An event that will wake the following call to poll_block(). */
struct poll_waiter {
/* Set when the waiter is created. */
- struct list node; /* Element in global waiters list. */
+ struct ovs_list node; /* Element in global waiters list. */
int fd; /* File descriptor. */
short int events; /* Events to wait for (POLLIN, POLLOUT). */
poll_fd_func *function; /* Callback function, if any, or null. */
*
* fat_rwlock_destroy() sets 'rwlock' to NULL to indicate that this
* slot may be destroyed. */
- struct list list_node; /* In struct rwlock's 'threads' list. */
+ struct ovs_list list_node; /* In struct rwlock's 'threads' list. */
struct fat_rwlock *rwlock; /* Owner. */
/* Mutex.
/* Contains "struct fat_rwlock_slot"s, one for each thread that has taken
* this lock. Guarded by 'mutex'. */
- struct list threads OVS_GUARDED;
+ struct ovs_list threads OVS_GUARDED;
struct ovs_mutex mutex;
};
* the list. */
size_t
guarded_list_push_back(struct guarded_list *list,
- struct list *node, size_t max)
+ struct ovs_list *node, size_t max)
{
size_t retval = 0;
return retval;
}
-struct list *
+struct ovs_list *
guarded_list_pop_front(struct guarded_list *list)
{
- struct list *node = NULL;
+ struct ovs_list *node = NULL;
ovs_mutex_lock(&list->mutex);
if (list->n) {
}
size_t
-guarded_list_pop_all(struct guarded_list *list, struct list *elements)
+guarded_list_pop_all(struct guarded_list *list, struct ovs_list *elements)
{
size_t n;
struct guarded_list {
struct ovs_mutex mutex;
- struct list list;
+ struct ovs_list list;
size_t n;
};
bool guarded_list_is_empty(const struct guarded_list *);
-size_t guarded_list_push_back(struct guarded_list *, struct list *,
+size_t guarded_list_push_back(struct guarded_list *, struct ovs_list *,
size_t max);
-struct list *guarded_list_pop_front(struct guarded_list *);
-size_t guarded_list_pop_all(struct guarded_list *, struct list *);
+struct ovs_list *guarded_list_pop_front(struct guarded_list *);
+size_t guarded_list_pop_all(struct guarded_list *, struct ovs_list *);
#endif /* guarded-list.h */
struct json_parser *parser;
/* Output. */
- struct list output; /* Contains "struct ofpbuf"s. */
+ struct ovs_list output; /* Contains "struct ofpbuf"s. */
size_t output_count; /* Number of elements in "output". */
size_t backlog;
};
};
struct lacp {
- struct list node; /* Node in all_lacps list. */
+ struct ovs_list node; /* Node in all_lacps list. */
char *name; /* Name of this lacp object. */
uint8_t sys_id[ETH_ADDR_LEN]; /* System ID. */
uint16_t sys_priority; /* System Priority. */
};
static struct ovs_mutex mutex;
-static struct list all_lacps__ = LIST_INITIALIZER(&all_lacps__);
-static struct list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__;
+static struct ovs_list all_lacps__ = LIST_INITIALIZER(&all_lacps__);
+static struct ovs_list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__;
static void lacp_update_attached(struct lacp *) OVS_REQUIRES(mutex);
#include "util.h"
/* Doubly linked list head or element. */
-struct list {
- struct list *prev; /* Previous list element. */
- struct list *next; /* Next list element. */
+struct ovs_list {
+ struct ovs_list *prev; /* Previous list element. */
+ struct ovs_list *next; /* Next list element. */
};
#define LIST_INITIALIZER(LIST) { LIST, LIST }
-static inline void list_init(struct list *);
-static inline void list_poison(struct list *);
+static inline void list_init(struct ovs_list *);
+static inline void list_poison(struct ovs_list *);
/* List insertion. */
-static inline void list_insert(struct list *, struct list *);
-static inline void list_splice(struct list *before, struct list *first,
- struct list *last);
-static inline void list_push_front(struct list *, struct list *);
-static inline void list_push_back(struct list *, struct list *);
-static inline void list_replace(struct list *, const struct list *);
-static inline void list_moved(struct list *);
-static inline void list_move(struct list *dst, struct list *src);
+static inline void list_insert(struct ovs_list *, struct ovs_list *);
+static inline void list_splice(struct ovs_list *before, struct ovs_list *first,
+ struct ovs_list *last);
+static inline void list_push_front(struct ovs_list *, struct ovs_list *);
+static inline void list_push_back(struct ovs_list *, struct ovs_list *);
+static inline void list_replace(struct ovs_list *, const struct ovs_list *);
+static inline void list_moved(struct ovs_list *);
+static inline void list_move(struct ovs_list *dst, struct ovs_list *src);
/* List removal. */
-static inline struct list *list_remove(struct list *);
-static inline struct list *list_pop_front(struct list *);
-static inline struct list *list_pop_back(struct list *);
+static inline struct ovs_list *list_remove(struct ovs_list *);
+static inline struct ovs_list *list_pop_front(struct ovs_list *);
+static inline struct ovs_list *list_pop_back(struct ovs_list *);
/* List elements. */
-static inline struct list *list_front(const struct list *);
-static inline struct list *list_back(const struct list *);
+static inline struct ovs_list *list_front(const struct ovs_list *);
+static inline struct ovs_list *list_back(const struct ovs_list *);
/* List properties. */
-static inline size_t list_size(const struct list *);
-static inline bool list_is_empty(const struct list *);
-static inline bool list_is_singleton(const struct list *);
-static inline bool list_is_short(const struct list *);
+static inline size_t list_size(const struct ovs_list *);
+static inline bool list_is_empty(const struct ovs_list *);
+static inline bool list_is_singleton(const struct ovs_list *);
+static inline bool list_is_short(const struct ovs_list *);
#define LIST_FOR_EACH(ITER, MEMBER, LIST) \
for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER); \
/* Initializes 'list' as an empty list. */
static inline void
-list_init(struct list *list)
+list_init(struct ovs_list *list)
{
list->next = list->prev = list;
}
/* Initializes 'list' with pointers that will (probably) cause segfaults if
* dereferenced and, better yet, show up clearly in a debugger. */
static inline void
-list_poison(struct list *list)
+list_poison(struct ovs_list *list)
{
memset(list, 0xcc, sizeof *list);
}
/* Inserts 'elem' just before 'before'. */
static inline void
-list_insert(struct list *before, struct list *elem)
+list_insert(struct ovs_list *before, struct ovs_list *elem)
{
elem->prev = before->prev;
elem->next = before;
/* Removes elements 'first' though 'last' (exclusive) from their current list,
then inserts them just before 'before'. */
static inline void
-list_splice(struct list *before, struct list *first, struct list *last)
+list_splice(struct ovs_list *before, struct ovs_list *first, struct ovs_list *last)
{
if (first == last) {
return;
/* Inserts 'elem' at the beginning of 'list', so that it becomes the front in
'list'. */
static inline void
-list_push_front(struct list *list, struct list *elem)
+list_push_front(struct ovs_list *list, struct ovs_list *elem)
{
list_insert(list->next, elem);
}
/* Inserts 'elem' at the end of 'list', so that it becomes the back in
* 'list'. */
static inline void
-list_push_back(struct list *list, struct list *elem)
+list_push_back(struct ovs_list *list, struct ovs_list *elem)
{
list_insert(list, elem);
}
/* Puts 'elem' in the position currently occupied by 'position'.
* Afterward, 'position' is not part of a list. */
static inline void
-list_replace(struct list *element, const struct list *position)
+list_replace(struct ovs_list *element, const struct ovs_list *position)
{
element->next = position->next;
element->next->prev = element;
* of a non-empty list. It fails badly, however, if 'list' is the head of an
* empty list; just use list_init() in that case. */
static inline void
-list_moved(struct list *list)
+list_moved(struct ovs_list *list)
{
list->prev->next = list->next->prev = list;
}
* around in memory. The effect is that, if 'src' was the head of a list, now
* 'dst' is the head of a list containing the same elements. */
static inline void
-list_move(struct list *dst, struct list *src)
+list_move(struct ovs_list *dst, struct ovs_list *src)
{
if (!list_is_empty(src)) {
*dst = *src;
/* Removes 'elem' from its list and returns the element that followed it.
Undefined behavior if 'elem' is not in a list. */
-static inline struct list *
-list_remove(struct list *elem)
+static inline struct ovs_list *
+list_remove(struct ovs_list *elem)
{
elem->prev->next = elem->next;
elem->next->prev = elem->prev;
/* Removes the front element from 'list' and returns it. Undefined behavior if
'list' is empty before removal. */
-static inline struct list *
-list_pop_front(struct list *list)
+static inline struct ovs_list *
+list_pop_front(struct ovs_list *list)
{
- struct list *front = list->next;
+ struct ovs_list *front = list->next;
list_remove(front);
return front;
/* Removes the back element from 'list' and returns it.
Undefined behavior if 'list' is empty before removal. */
-static inline struct list *
-list_pop_back(struct list *list)
+static inline struct ovs_list *
+list_pop_back(struct ovs_list *list)
{
- struct list *back = list->prev;
+ struct ovs_list *back = list->prev;
list_remove(back);
return back;
/* Returns the front element in 'list_'.
Undefined behavior if 'list_' is empty. */
-static inline struct list *
-list_front(const struct list *list_)
+static inline struct ovs_list *
+list_front(const struct ovs_list *list_)
{
- struct list *list = CONST_CAST(struct list *, list_);
+ struct ovs_list *list = CONST_CAST(struct ovs_list *, list_);
ovs_assert(!list_is_empty(list));
/* Returns the back element in 'list_'.
Undefined behavior if 'list_' is empty. */
-static inline struct list *
-list_back(const struct list *list_)
+static inline struct ovs_list *
+list_back(const struct ovs_list *list_)
{
- struct list *list = CONST_CAST(struct list *, list_);
+ struct ovs_list *list = CONST_CAST(struct ovs_list *, list_);
ovs_assert(!list_is_empty(list));
/* Returns the number of elements in 'list'.
Runs in O(n) in the number of elements. */
static inline size_t
-list_size(const struct list *list)
+list_size(const struct ovs_list *list)
{
- const struct list *e;
+ const struct ovs_list *e;
size_t cnt = 0;
for (e = list->next; e != list; e = e->next) {
/* Returns true if 'list' is empty, false otherwise. */
static inline bool
-list_is_empty(const struct list *list)
+list_is_empty(const struct ovs_list *list)
{
return list->next == list;
}
/* Returns true if 'list' has exactly 1 element, false otherwise. */
static inline bool
-list_is_singleton(const struct list *list)
+list_is_singleton(const struct ovs_list *list)
{
return list_is_short(list) && !list_is_empty(list);
}
/* Returns true if 'list' has 0 or 1 elements, false otherwise. */
static inline bool
-list_is_short(const struct list *list)
+list_is_short(const struct ovs_list *list)
{
return list->next == list->prev;
}
}
static struct mac_entry *
-mac_entry_from_lru_node(struct list *list)
+mac_entry_from_lru_node(struct ovs_list *list)
{
return CONTAINER_OF(list, struct mac_entry, lru_node);
}
/* The following are marked guarded to prevent users from iterating over or
* accessing a mac_entry without hodling the parent mac_learning rwlock. */
- struct list lru_node OVS_GUARDED; /* Element in 'lrus' list. */
+ struct ovs_list lru_node OVS_GUARDED; /* Element in 'lrus' list. */
/* Learned port. */
union {
/* MAC learning table. */
struct mac_learning {
struct hmap table; /* Learning table. */
- struct list lrus OVS_GUARDED; /* In-use entries, least recently used at the
+ struct ovs_list lrus OVS_GUARDED; /* In-use entries, least recently used at the
front, most recently used at the back. */
uint32_t secret; /* Secret for randomizing hash table. */
unsigned long *flood_vlans; /* Bitmap of learning disabled VLANs. */
}
static struct mcast_group_bundle *
-mcast_group_bundle_from_lru_node(struct list *list)
+mcast_group_bundle_from_lru_node(struct ovs_list *list)
{
return CONTAINER_OF(list, struct mcast_group_bundle, bundle_node);
}
static struct mcast_group *
-mcast_group_from_lru_node(struct list *list)
+mcast_group_from_lru_node(struct ovs_list *list)
{
return CONTAINER_OF(list, struct mcast_group, group_node);
}
}
static struct mcast_mrouter_bundle *
-mcast_mrouter_from_lru_node(struct list *list)
+mcast_mrouter_from_lru_node(struct ovs_list *list)
{
return CONTAINER_OF(list, struct mcast_mrouter_bundle, mrouter_node);
}
/* Flood ports. */
static struct mcast_fport_bundle *
-mcast_fport_from_list_node(struct list *list)
+mcast_fport_from_list_node(struct ovs_list *list)
{
return CONTAINER_OF(list, struct mcast_fport_bundle, fport_node);
}
uint16_t vlan;
/* Node in parent struct mcast_snooping group_lru. */
- struct list group_node OVS_GUARDED;
+ struct ovs_list group_node OVS_GUARDED;
/* Contains struct mcast_group_bundle (ports), least recently used
* at the front, most recently used at the back. */
- struct list bundle_lru OVS_GUARDED;
+ struct ovs_list bundle_lru OVS_GUARDED;
};
/* The bundle associated to the multicast group.
* Guarded by owning 'mcast_snooping''s rwlock. */
struct mcast_group_bundle {
/* Node in parent struct mcast_group bundle_lru list. */
- struct list bundle_node OVS_GUARDED;
+ struct ovs_list bundle_node OVS_GUARDED;
/* When this node expires. */
time_t expires;
* Guarded by owning 'mcast_snooping''s rwlock. */
struct mcast_mrouter_bundle {
/* Node in parent struct mcast_group mrouter_lru list. */
- struct list mrouter_node OVS_GUARDED;
+ struct ovs_list mrouter_node OVS_GUARDED;
/* When this node expires. */
time_t expires;
* Guarded by owning 'mcast_snooping''s rwlock */
struct mcast_fport_bundle {
/* Node in parent struct mcast_snooping fport_list. */
- struct list fport_node;
+ struct ovs_list fport_node;
/* VLAN tag. */
uint16_t vlan;
/* Contains struct mcast_group, least recently used at the front,
* most recently used at the back. */
- struct list group_lru OVS_GUARDED;
+ struct ovs_list group_lru OVS_GUARDED;
/* Contains struct mcast_mrouter_bundle, least recently used at the
* front, most recently used at the back. */
- struct list mrouter_lru OVS_GUARDED;
+ struct ovs_list mrouter_lru OVS_GUARDED;
/* Contains struct mcast_fport_bundle to be flooded with multicast
* packets in no special order. */
- struct list fport_list OVS_GUARDED;
+ struct ovs_list fport_list OVS_GUARDED;
/* Secret for randomizing hash table. */
uint32_t secret;
static struct ovs_mutex dpdk_mutex = OVS_MUTEX_INITIALIZER;
/* Contains all 'struct dpdk_dev's. */
-static struct list dpdk_list OVS_GUARDED_BY(dpdk_mutex)
+static struct ovs_list dpdk_list OVS_GUARDED_BY(dpdk_mutex)
= LIST_INITIALIZER(&dpdk_list);
-static struct list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex)
+static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex)
= LIST_INITIALIZER(&dpdk_mp_list);
/* This mutex must be used by non pmd threads when allocating or freeing
int mtu;
int socket_id;
int refcount;
- struct list list_node OVS_GUARDED_BY(dpdk_mutex);
+ struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex);
};
/* There should be one 'struct dpdk_tx_queue' created for
so we have to keep them around once they've been created
*/
-static struct list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex)
+static struct ovs_list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex)
= LIST_INITIALIZER(&dpdk_ring_list);
struct dpdk_ring {
struct rte_ring *cring_rx;
int user_port_id; /* User given port no, parsed from port name */
int eth_port_id; /* ethernet device port id */
- struct list list_node OVS_GUARDED_BY(dpdk_mutex);
+ struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex);
};
struct netdev_dpdk {
int link_reset_cnt;
/* In dpdk_list. */
- struct list list_node OVS_GUARDED_BY(dpdk_mutex);
+ struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex);
rte_spinlock_t dpdkr_tx_lock;
};
struct dummy_packet_stream {
struct stream *stream;
struct ofpbuf rxbuf;
- struct list txq;
+ struct ovs_list txq;
};
enum dummy_packet_conn_type {
static struct ovs_mutex dummy_list_mutex = OVS_MUTEX_INITIALIZER;
/* Contains all 'struct dummy_dev's. */
-static struct list dummy_list OVS_GUARDED_BY(dummy_list_mutex)
+static struct ovs_list dummy_list OVS_GUARDED_BY(dummy_list_mutex)
= LIST_INITIALIZER(&dummy_list);
struct netdev_dummy {
struct netdev up;
/* In dummy_list. */
- struct list list_node OVS_GUARDED_BY(dummy_list_mutex);
+ struct ovs_list list_node OVS_GUARDED_BY(dummy_list_mutex);
/* Protects all members below. */
struct ovs_mutex mutex OVS_ACQ_AFTER(dummy_list_mutex);
FILE *tx_pcap, *rxq_pcap OVS_GUARDED;
struct in_addr address, netmask;
- struct list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */
+ struct ovs_list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */
};
/* Max 'recv_queue_len' in struct netdev_dummy. */
struct netdev_rxq_dummy {
struct netdev_rxq up;
- struct list node; /* In netdev_dummy's "rxes" list. */
- struct list recv_queue;
+ struct ovs_list node; /* In netdev_dummy's "rxes" list. */
+ struct ovs_list recv_queue;
int recv_queue_len; /* list_size(&recv_queue). */
struct seq *seq; /* Reports newly queued packets. */
};
int n_rxq;
int ref_cnt; /* Times this devices was opened. */
struct shash_node *node; /* Pointer to element in global map. */
- struct list saved_flags_list; /* Contains "struct netdev_saved_flags". */
+ struct ovs_list saved_flags_list; /* Contains "struct netdev_saved_flags". */
};
static void
struct netdev_saved_flags {
struct netdev *netdev;
- struct list node; /* In struct netdev's saved_flags_list. */
+ struct ovs_list node; /* In struct netdev's saved_flags_list. */
enum netdev_flags saved_flags;
enum netdev_flags saved_values;
};
struct nln {
struct nl_sock *notify_sock; /* Netlink socket. */
- struct list all_notifiers; /* All nln notifiers. */
+ struct ovs_list all_notifiers; /* All nln notifiers. */
bool has_run; /* Guard for run and wait functions. */
/* Passed in by nln_create(). */
struct nln_notifier {
struct nln *nln; /* Parent nln. */
- struct list node;
+ struct ovs_list node;
nln_notify_func *cb;
void *aux;
};
struct nxm_field_index {
struct hmap_node header_node; /* In nxm_header_map. */
struct hmap_node name_node; /* In nxm_name_map. */
- struct list mf_node; /* In mf_mf_map[nf.id]. */
+ struct ovs_list mf_node; /* In mf_mf_map[nf.id]. */
const struct nxm_field nf;
};
static struct hmap nxm_header_map;
static struct hmap nxm_name_map;
-static struct list nxm_mf_map[MFF_N_IDS];
+static struct ovs_list nxm_mf_map[MFF_N_IDS];
static void
nxm_init(void)
* use calls to the other ofpmp_*() functions to add to the body and split the
* message into multiple parts, if necessary. */
void
-ofpmp_init(struct list *replies, const struct ofp_header *request)
+ofpmp_init(struct ovs_list *replies, const struct ofp_header *request)
{
struct ofpbuf *msg;
* have not actually been allocated, so the caller must do so with
* e.g. ofpbuf_put_uninit(). */
struct ofpbuf *
-ofpmp_reserve(struct list *replies, size_t len)
+ofpmp_reserve(struct ovs_list *replies, size_t len)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
/* Appends 'len' bytes to the series of statistics replies in 'replies', and
* returns the first byte. */
void *
-ofpmp_append(struct list *replies, size_t len)
+ofpmp_append(struct ovs_list *replies, size_t len)
{
return ofpbuf_put_uninit(ofpmp_reserve(replies, len), len);
}
* the first 'start_ofs' bytes, the second one containing the bytes from that
* offset onward. */
void
-ofpmp_postappend(struct list *replies, size_t start_ofs)
+ofpmp_postappend(struct ovs_list *replies, size_t start_ofs)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
/* Returns the OpenFlow version of the replies being constructed in 'replies',
* which should have been initialized by ofpmp_init(). */
enum ofp_version
-ofpmp_version(struct list *replies)
+ofpmp_version(struct ovs_list *replies)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
const struct ofp_header *oh = ofpbuf_data(msg);
/* Determines the OFPRAW_* type of the OpenFlow messages in 'replies', which
* should have been initialized by ofpmp_init(). */
enum ofpraw
-ofpmp_decode_raw(struct list *replies)
+ofpmp_decode_raw(struct ovs_list *replies)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
enum ofperr error;
#include "ofp-errors.h"
#include "util.h"
-struct list;
+struct ovs_list;
\f
/* Raw identifiers for OpenFlow messages.
*
* within 64 kB doesn't need any special treatment, so you might as well use
* the ofpraw_alloc_*() functions.
*
- * These functions work with a "struct list" of "struct ofpbuf"s, each of
+ * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of
* which represents one part of a multipart message. */
-void ofpmp_init(struct list *, const struct ofp_header *request);
-struct ofpbuf *ofpmp_reserve(struct list *, size_t len);
-void *ofpmp_append(struct list *, size_t len);
-void ofpmp_postappend(struct list *, size_t start_ofs);
+void ofpmp_init(struct ovs_list *, const struct ofp_header *request);
+struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len);
+void *ofpmp_append(struct ovs_list *, size_t len);
+void ofpmp_postappend(struct ovs_list *, size_t start_ofs);
-enum ofp_version ofpmp_version(struct list *);
-enum ofpraw ofpmp_decode_raw(struct list *);
+enum ofp_version ofpmp_version(struct ovs_list *);
+enum ofpraw ofpmp_decode_raw(struct ovs_list *);
/* Decoding multipart replies. */
uint16_t ofpmp_flags(const struct ofp_header *);
static void
ofp_print_group(struct ds *s, uint32_t group_id, uint8_t type,
- struct list *p_buckets, enum ofp_version ofp_version,
+ struct ovs_list *p_buckets, enum ofp_version ofp_version,
bool suppress_type)
{
struct ofputil_bucket *bucket;
/* Encode a meter stat for 'mc' and append it to 'replies'. */
void
-ofputil_append_meter_config(struct list *replies,
+ofputil_append_meter_config(struct ovs_list *replies,
const struct ofputil_meter_config *mc)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
/* Encode a meter stat for 'ms' and append it to 'replies'. */
void
-ofputil_append_meter_stats(struct list *replies,
+ofputil_append_meter_stats(struct ovs_list *replies,
const struct ofputil_meter_stats *ms)
{
struct ofp13_meter_stats *reply;
* have been initialized with ofpmp_init(). */
void
ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *fs,
- struct list *replies)
+ struct ovs_list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
size_t start_ofs = ofpbuf_size(reply);
void
ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp,
- struct list *replies)
+ struct ovs_list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
size_t start_ofs = ofpbuf_size(reply);
void
ofputil_append_table_features_reply(const struct ofputil_table_features *tf,
- struct list *replies)
+ struct ovs_list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
enum ofp_version version = ofpmp_version(replies);
}
void
-ofputil_start_flow_update(struct list *replies)
+ofputil_start_flow_update(struct ovs_list *replies)
{
struct ofpbuf *msg;
void
ofputil_append_flow_update(const struct ofputil_flow_update *update,
- struct list *replies)
+ struct ovs_list *replies)
{
enum ofp_version version = ofpmp_version(replies);
struct nx_flow_update_header *nfuh;
static void
ofputil_append_ofp14_port_stats(const struct ofputil_port_stats *ops,
- struct list *replies)
+ struct ovs_list *replies)
{
struct ofp14_port_stats_prop_ethernet *eth;
struct ofp14_port_stats *ps14;
/* Encode a ports stat for 'ops' and append it to 'replies'. */
void
-ofputil_append_port_stat(struct list *replies,
+ofputil_append_port_stat(struct ovs_list *replies,
const struct ofputil_port_stats *ops)
{
switch (ofpmp_version(replies)) {
/* Frees all of the "struct ofputil_bucket"s in the 'buckets' list. */
void
-ofputil_bucket_list_destroy(struct list *buckets)
+ofputil_bucket_list_destroy(struct ovs_list *buckets)
{
struct ofputil_bucket *bucket, *next_bucket;
* This allows all of 'src' or 'all of 'src' except 'skip' to
* be cloned and appended to 'dest'. */
void
-ofputil_bucket_clone_list(struct list *dest, const struct list *src,
+ofputil_bucket_clone_list(struct ovs_list *dest, const struct ovs_list *src,
const struct ofputil_bucket *skip)
{
struct ofputil_bucket *bucket;
/* Find a bucket in the list 'buckets' whose bucket id is 'bucket_id'
* Returns the first bucket found or NULL if no buckets are found. */
struct ofputil_bucket *
-ofputil_bucket_find(const struct list *buckets, uint32_t bucket_id)
+ofputil_bucket_find(const struct ovs_list *buckets, uint32_t bucket_id)
{
struct ofputil_bucket *bucket;
/* Returns true if more than one bucket in the list 'buckets'
* have the same bucket id. Returns false otherwise. */
bool
-ofputil_bucket_check_duplicate_id(const struct list *buckets)
+ofputil_bucket_check_duplicate_id(const struct ovs_list *buckets)
{
struct ofputil_bucket *i, *j;
/* Returns the bucket at the front of the list 'buckets'.
* Undefined if 'buckets is empty. */
struct ofputil_bucket *
-ofputil_bucket_list_front(const struct list *buckets)
+ofputil_bucket_list_front(const struct ovs_list *buckets)
{
static struct ofputil_bucket *bucket;
/* Returns the bucket at the back of the list 'buckets'.
* Undefined if 'buckets is empty. */
struct ofputil_bucket *
-ofputil_bucket_list_back(const struct list *buckets)
+ofputil_bucket_list_back(const struct ovs_list *buckets)
{
static struct ofputil_bucket *bucket;
* replies already begun in 'replies' and appends it to the list. 'replies'
* must have originally been initialized with ofpmp_init(). */
void
-ofputil_append_group_stats(struct list *replies,
+ofputil_append_group_stats(struct ovs_list *replies,
const struct ofputil_group_stats *gs)
{
size_t bucket_counter_size;
static void
ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds,
- struct list *buckets,
- struct list *replies,
+ struct ovs_list *buckets,
+ struct ovs_list *replies,
enum ofp_version version)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
static void
ofputil_append_ofp15_group_desc_reply(const struct ofputil_group_desc *gds,
- struct list *buckets,
- struct list *replies,
+ struct ovs_list *buckets,
+ struct ovs_list *replies,
enum ofp_version version)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
* initialized with ofpmp_init(). */
void
ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds,
- struct list *buckets,
- struct list *replies)
+ struct ovs_list *buckets,
+ struct ovs_list *replies)
{
enum ofp_version version = ofpmp_version(replies);
static enum ofperr
ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
- enum ofp_version version, struct list *buckets)
+ enum ofp_version version, struct ovs_list *buckets)
{
struct ofp11_bucket *ob;
uint32_t bucket_id = 0;
static enum ofperr
ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length,
- enum ofp_version version, struct list *buckets)
+ enum ofp_version version, struct ovs_list *buckets)
{
struct ofp15_bucket *ob;
/* Encode a queue stat for 'oqs' and append it to 'replies'. */
void
-ofputil_append_queue_stat(struct list *replies,
+ofputil_append_queue_stat(struct ovs_list *replies,
const struct ofputil_queue_stats *oqs)
{
switch (ofpmp_version(replies)) {
* The handling of cookies across multiple versions of OpenFlow is a bit
* confusing. See DESIGN for the details. */
struct ofputil_flow_mod {
- struct list list_node; /* For queuing flow_mods. */
+ struct ovs_list list_node; /* For queuing flow_mods. */
struct match match;
int priority;
bool flow_age_extension,
struct ofpbuf *ofpacts);
void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *,
- struct list *replies);
+ struct ovs_list *replies);
/* Aggregate stats reply, independent of protocol. */
struct ofputil_aggregate_stats {
struct ofpbuf *ofputil_encode_table_features_request(enum ofp_version);
void ofputil_append_table_features_reply(
- const struct ofputil_table_features *tf, struct list *replies);
+ const struct ofputil_table_features *tf, struct ovs_list *replies);
/* Meter band configuration for all supported band types. */
struct ofputil_meter_band {
void ofputil_decode_meter_request(const struct ofp_header *,
uint32_t *meter_id);
-void ofputil_append_meter_config(struct list *replies,
+void ofputil_append_meter_config(struct ovs_list *replies,
const struct ofputil_meter_config *);
-void ofputil_append_meter_stats(struct list *replies,
+void ofputil_append_meter_stats(struct ovs_list *replies,
const struct ofputil_meter_stats *);
enum ofputil_meter_request_type {
int ofputil_decode_flow_update(struct ofputil_flow_update *,
struct ofpbuf *msg, struct ofpbuf *ofpacts);
-void ofputil_start_flow_update(struct list *replies);
+void ofputil_start_flow_update(struct ovs_list *replies);
void ofputil_append_flow_update(const struct ofputil_flow_update *,
- struct list *replies);
+ struct ovs_list *replies);
/* Abstract nx_flow_monitor_cancel. */
uint32_t ofputil_decode_flow_monitor_cancel(const struct ofp_header *);
enum ofp_version ofp_version, ofp_port_t);
void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp,
- struct list *replies);
+ struct ovs_list *replies);
/* Encoding simple OpenFlow messages. */
struct ofpbuf *make_echo_request(enum ofp_version);
struct ofpbuf *ofputil_encode_dump_ports_request(enum ofp_version ofp_version,
ofp_port_t port);
-void ofputil_append_port_stat(struct list *replies,
+void ofputil_append_port_stat(struct ovs_list *replies,
const struct ofputil_port_stats *ops);
size_t ofputil_count_port_stats(const struct ofp_header *);
int ofputil_decode_port_stats(struct ofputil_port_stats *, struct ofpbuf *msg);
size_t ofputil_count_queue_stats(const struct ofp_header *);
int ofputil_decode_queue_stats(struct ofputil_queue_stats *qs, struct ofpbuf *msg);
-void ofputil_append_queue_stat(struct list *replies,
+void ofputil_append_queue_stat(struct ovs_list *replies,
const struct ofputil_queue_stats *oqs);
struct bucket_counter {
/* Bucket for use in groups. */
struct ofputil_bucket {
- struct list list_node;
+ struct ovs_list list_node;
uint16_t weight; /* Relative weight, for "select" groups. */
ofp_port_t watch_port; /* Port whose state affects whether this bucket
* is live. Only required for fast failover
* OFPGC15_INSERT_BUCKET and
* OFPGC15_REMOVE_BUCKET commands
* execution.*/
- struct list buckets; /* Contains "struct ofputil_bucket"s. */
+ struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */
};
/* Group stats reply, independent of protocol. */
struct ofputil_group_desc {
uint8_t type; /* One of OFPGT_*. */
uint32_t group_id; /* Group identifier. */
- struct list buckets; /* Contains "struct ofputil_bucket"s. */
+ struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */
};
-void ofputil_bucket_list_destroy(struct list *buckets);
-void ofputil_bucket_clone_list(struct list *dest, const struct list *src,
+void ofputil_bucket_list_destroy(struct ovs_list *buckets);
+void ofputil_bucket_clone_list(struct ovs_list *dest,
+ const struct ovs_list *src,
const struct ofputil_bucket *);
-struct ofputil_bucket *ofputil_bucket_find(const struct list *,
+struct ofputil_bucket *ofputil_bucket_find(const struct ovs_list *,
uint32_t bucket_id);
-bool ofputil_bucket_check_duplicate_id(const struct list *);
-struct ofputil_bucket *ofputil_bucket_list_front(const struct list *);
-struct ofputil_bucket *ofputil_bucket_list_back(const struct list *);
+bool ofputil_bucket_check_duplicate_id(const struct ovs_list *);
+struct ofputil_bucket *ofputil_bucket_list_front(const struct ovs_list *);
+struct ofputil_bucket *ofputil_bucket_list_back(const struct ovs_list *);
static inline bool
ofputil_bucket_has_liveness(const struct ofputil_bucket *bucket)
uint32_t group_id);
enum ofperr ofputil_decode_group_stats_request(
const struct ofp_header *request, uint32_t *group_id);
-void ofputil_append_group_stats(struct list *replies,
+void ofputil_append_group_stats(struct ovs_list *replies,
const struct ofputil_group_stats *);
struct ofpbuf *ofputil_encode_group_features_request(enum ofp_version);
struct ofpbuf *ofputil_encode_group_features_reply(
struct ofpbuf *, enum ofp_version);
void ofputil_append_group_desc_reply(const struct ofputil_group_desc *,
- struct list *buckets,
- struct list *replies);
+ struct ovs_list *buckets,
+ struct ovs_list *replies);
struct ofputil_bundle_ctrl_msg {
uint32_t bundle_id;
/* Removes each of the "struct ofpbuf"s on 'list' from the list and frees
* them. */
void
-ofpbuf_list_delete(struct list *list)
+ofpbuf_list_delete(struct ovs_list *list)
{
struct ofpbuf *b, *next;
or UINT16_MAX. */
uint16_t l4_ofs; /* Transport-level header offset from 'frame',
or UINT16_MAX. */
- struct list list_node; /* Private list element for use by owner. */
+ struct ovs_list list_node; /* Private list element for use by owner. */
};
static inline void * ofpbuf_data(const struct ofpbuf *);
void *ofpbuf_steal_data(struct ofpbuf *);
char *ofpbuf_to_string(const struct ofpbuf *, size_t maxbytes);
-static inline struct ofpbuf *ofpbuf_from_list(const struct list *);
-void ofpbuf_list_delete(struct list *);
+static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *);
+void ofpbuf_list_delete(struct ovs_list *);
static inline bool ofpbuf_equal(const struct ofpbuf *, const struct ofpbuf *);
\f
? ofpbuf_pull(b, size) : NULL;
}
-static inline struct ofpbuf *ofpbuf_from_list(const struct list *list)
+static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *list)
{
return CONTAINER_OF(list, struct ofpbuf, list_node);
}
/* numa node. */
struct numa_node {
struct hmap_node hmap_node; /* In the 'all_numa_nodes'. */
- struct list cores; /* List of cpu cores on the numa node. */
+ struct ovs_list cores; /* List of cpu cores on the numa node. */
int numa_id; /* numa node id. */
};
/* Cpu core on a numa node. */
struct cpu_core {
struct hmap_node hmap_node;/* In the 'all_cpu_cores'. */
- struct list list_node; /* In 'numa_node->cores' list. */
+ struct ovs_list list_node; /* In 'numa_node->cores' list. */
struct numa_node *numa; /* numa node containing the core. */
int core_id; /* Core id. */
bool available; /* If the core can be pinned. */
};
struct ovsrcu_cbset {
- struct list list_node;
+ struct ovs_list list_node;
struct ovsrcu_cb cbs[16];
int n_cbs;
};
struct ovsrcu_perthread {
- struct list list_node; /* In global list. */
+ struct ovs_list list_node; /* In global list. */
struct ovs_mutex mutex;
uint64_t seqno;
static struct seq *global_seqno;
static pthread_key_t perthread_key;
-static struct list ovsrcu_threads;
+static struct ovs_list ovsrcu_threads;
static struct ovs_mutex ovsrcu_threads_mutex;
static struct guarded_list flushed_cbsets;
ovsrcu_call_postponed(void)
{
struct ovsrcu_cbset *cbset, *next_cbset;
- struct list cbsets;
+ struct ovs_list cbsets;
guarded_list_pop_all(&flushed_cbsets, &cbsets);
if (list_is_empty(&cbsets)) {
/* A piece of thread-specific data. */
struct ovsthread_key {
- struct list list_node; /* In 'inuse_keys' or 'free_keys'. */
+ struct ovs_list list_node; /* In 'inuse_keys' or 'free_keys'. */
void (*destructor)(void *); /* Called at thread exit. */
/* Indexes into the per-thread array in struct ovsthread_key_slots.
/* Per-thread data structure. */
struct ovsthread_key_slots {
- struct list list_node; /* In 'slots_list'. */
+ struct ovs_list list_node; /* In 'slots_list'. */
void **p1[L1_SIZE];
};
*
* Together, 'inuse_keys' and 'free_keys' hold an ovsthread_key for every index
* from 0 to n_keys - 1, inclusive. */
-static struct list inuse_keys OVS_GUARDED_BY(key_mutex)
+static struct ovs_list inuse_keys OVS_GUARDED_BY(key_mutex)
= LIST_INITIALIZER(&inuse_keys);
-static struct list free_keys OVS_GUARDED_BY(key_mutex)
+static struct ovs_list free_keys OVS_GUARDED_BY(key_mutex)
= LIST_INITIALIZER(&free_keys);
static unsigned int n_keys OVS_GUARDED_BY(key_mutex);
/* All existing struct ovsthread_key_slots. */
-static struct list slots_list OVS_GUARDED_BY(key_mutex)
+static struct ovs_list slots_list OVS_GUARDED_BY(key_mutex)
= LIST_INITIALIZER(&slots_list);
static void *
struct ovsdb_idl_row {
struct hmap_node hmap_node; /* In struct ovsdb_idl_table's 'rows'. */
struct uuid uuid; /* Row "_uuid" field. */
- struct list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */
- struct list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */
+ struct ovs_list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */
+ struct ovs_list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */
struct ovsdb_idl_table *table; /* Containing table. */
struct ovsdb_datum *old; /* Committed data (null if orphaned). */
* tables.
*/
struct ovsdb_idl_arc {
- struct list src_node; /* In src->src_arcs list. */
- struct list dst_node; /* In dst->dst_arcs list. */
+ struct ovs_list src_node; /* In src->src_arcs list. */
+ struct ovs_list dst_node; /* In dst->dst_arcs list. */
struct ovsdb_idl_row *src; /* Source row. */
struct ovsdb_idl_row *dst; /* Destination row. */
};
COVERAGE_DEFINE(process_start);
struct process {
- struct list node;
+ struct ovs_list node;
char *name;
pid_t pid;
static int fds[2];
/* All processes. */
-static struct list all_processes = LIST_INITIALIZER(&all_processes);
+static struct ovs_list all_processes = LIST_INITIALIZER(&all_processes);
static void sigchld_handler(int signr OVS_UNUSED);
char *target; /* vconn name, passed to vconn_open(). */
bool reliable;
- struct list txq; /* Contains "struct ofpbuf"s. */
+ struct ovs_list txq; /* Contains "struct ofpbuf"s. */
int backoff;
int max_backoff;
* To be RCU-friendly, the struct rculist instances must be freed via
* ovsrcu_postpone().
*
- * The API is almost the same as for struct list, with the following exeptions:
+ * The API is almost the same as for struct ovs_list, with the following
+ * exeptions:
*
* - The 'prev' pointer may not be accessed by the user.
* - The 'next' pointer should be accessed via rculist_next() by readers, and
* write operation to the list element, hopefully crashing the program if
* the list node was freed or re-used too early.
*
- * The following functions are variations of the struct list functions with
+ * The following functions are variations of the struct ovs_list functions with
* similar names, but are now restricted to the writer use:
*
* - rculist_back_protected()
/* A non-existing mutex to make it more difficult for an user to accidentally
* keep using the 'prev' pointer. This may be helpful when porting code from
- * struct list to rculist. */
+ * struct ovs_list to rculist. */
extern struct ovs_mutex rculist_fake_mutex;
/* Doubly linked list head or element. */
};
struct rstp {
- struct list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */
+ struct ovs_list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */
char *name; /* Bridge name. */
/* Changes in last SM execution. */
struct ovs_mutex rstp_mutex = OVS_MUTEX_INITIALIZER;
-static struct list all_rstps__ = LIST_INITIALIZER(&all_rstps__);
-static struct list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__;
+static struct ovs_list all_rstps__ = LIST_INITIALIZER(&all_rstps__);
+static struct ovs_list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__;
/* Internal use only. */
static void rstp_set_bridge_address__(struct rstp *, rstp_identifier)
static int notify_sock = -1;
/* All registered notifiers. */
-static struct list all_notifiers = LIST_INITIALIZER(&all_notifiers);
+static struct ovs_list all_notifiers = LIST_INITIALIZER(&all_notifiers);
static void rtbsd_report_change(const struct if_msghdr *)
OVS_REQUIRES(rtbsd_mutex);
typedef void rtbsd_notify_func(const struct rtbsd_change *, void *aux);
struct rtbsd_notifier {
- struct list node;
+ struct ovs_list node;
rtbsd_notify_func *cb;
void *aux;
};
struct hmap_node hmap_node OVS_GUARDED; /* In 'seq->waiters'. */
unsigned int ovsthread_id OVS_GUARDED; /* Key in 'waiters' hmap. */
- struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */
- struct list list_node OVS_GUARDED; /* In 'thread->waiters'. */
+ struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */
+ struct ovs_list list_node OVS_GUARDED; /* In 'thread->waiters'. */
uint64_t value OVS_GUARDED; /* seq->value we're waiting to change. */
};
/* A thread that might be waiting on one or more seqs. */
struct seq_thread {
- struct list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */
+ struct ovs_list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */
struct latch latch OVS_GUARDED; /* Wakeup latch for this thread. */
bool waiting OVS_GUARDED; /* True if latch_wait() already called. */
};
* e.g.:
*
* struct ovs_mutex mutex;
- * struct list queue OVS_GUARDED_BY(mutex);
+ * struct ovs_list queue OVS_GUARDED_BY(mutex);
* struct seq nonempty_seq;
*
* To add an element to the queue:
};
struct stp {
- struct list node; /* Node in all_stps list. */
+ struct ovs_list node; /* Node in all_stps list. */
/* Static bridge data. */
char *name; /* Human-readable name for log messages. */
};
static struct ovs_mutex mutex;
-static struct list all_stps__ = LIST_INITIALIZER(&all_stps__);
-static struct list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__;
+static struct ovs_list all_stps__ = LIST_INITIALIZER(&all_stps__);
+static struct ovs_list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__;
#define FOR_EACH_ENABLED_PORT(PORT, STP) \
for ((PORT) = stp_next_enabled_port((STP), (STP)->ports); \
};
struct unixctl_conn {
- struct list node;
+ struct ovs_list node;
struct jsonrpc *rpc;
/* Only one request can be in progress at a time. While the request is
/* Server for control connection. */
struct unixctl_server {
struct pstream *listener;
- struct list conns;
+ struct ovs_list conns;
};
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
* All of the requests on 'requests' are always destroyed, regardless of the
* return value. */
int
-vconn_transact_multiple_noreply(struct vconn *vconn, struct list *requests,
+vconn_transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests,
struct ofpbuf **replyp)
{
struct ofpbuf *request, *next;
extern "C" {
#endif
-struct list;
+struct ovs_list;
struct ofpbuf;
struct pvconn;
struct vconn;
int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **);
int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **);
int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **);
-int vconn_transact_multiple_noreply(struct vconn *, struct list *requests,
+int vconn_transact_multiple_noreply(struct vconn *, struct ovs_list *requests,
struct ofpbuf **replyp);
void vconn_run(struct vconn *);
BUILD_ASSERT_DECL(LOG_LOCAL0 == (16 << 3));
/* The log modules. */
-struct list vlog_modules = LIST_INITIALIZER(&vlog_modules);
+struct ovs_list vlog_modules = LIST_INITIALIZER(&vlog_modules);
/* Protects the 'pattern' in all "struct facility"s, so that a race between
* changing and reading the pattern does not cause an access to freed
/* A log module. */
struct vlog_module {
- struct list list;
+ struct ovs_list list;
const char *name; /* User-visible name. */
int levels[VLF_N_FACILITIES]; /* Minimum log level for each facility. */
int min_level; /* Minimum log level for any facility. */
};
/* Global list of all logging modules */
-extern struct list vlog_modules;
+extern struct ovs_list vlog_modules;
/* Creates and initializes a global instance of a module named MODULE. */
#define VLOG_DEFINE_MODULE(MODULE) \
struct bond_slave *slave; /* Assigned slave, NULL if unassigned. */
uint64_t tx_bytes /* Count of bytes recently transmitted. */
OVS_GUARDED_BY(rwlock);
- struct list list_node; /* In bond_slave's 'entries' list. */
+ struct ovs_list list_node; /* In bond_slave's 'entries' list. */
/* Recirculation.
*
/* A bond slave, that is, one of the links comprising a bond. */
struct bond_slave {
struct hmap_node hmap_node; /* In struct bond's slaves hmap. */
- struct list list_node; /* In struct bond's enabled_slaves list. */
+ struct ovs_list list_node; /* In struct bond's enabled_slaves list. */
struct bond *bond; /* The bond that contains this slave. */
void *aux; /* Client-provided handle for this slave. */
bool may_enable; /* Client considers this slave bondable. */
/* Rebalancing info. Used only by bond_rebalance(). */
- struct list bal_node; /* In bond_rebalance()'s 'bals' list. */
- struct list entries; /* 'struct bond_entry's assigned here. */
+ struct ovs_list bal_node; /* In bond_rebalance()'s 'bals' list. */
+ struct ovs_list entries; /* 'struct bond_entry's assigned here. */
uint64_t tx_bytes; /* Sum across 'tx_bytes' of entries. */
};
* (To prevent the bond_slave from disappearing they must also hold
* 'rwlock'.) */
struct ovs_mutex mutex OVS_ACQ_AFTER(rwlock);
- struct list enabled_slaves OVS_GUARDED; /* Contains struct bond_slaves. */
+ struct ovs_list enabled_slaves OVS_GUARDED; /* Contains struct bond_slaves. */
/* Bonding info. */
enum bond_mode balance; /* Balancing mode, one of BM_*. */
}
static struct bond_slave *
-bond_slave_from_bal_node(struct list *bal) OVS_REQ_RDLOCK(rwlock)
+bond_slave_from_bal_node(struct ovs_list *bal) OVS_REQ_RDLOCK(rwlock)
{
return CONTAINER_OF(bal, struct bond_slave, bal_node);
}
static void
-log_bals(struct bond *bond, const struct list *bals)
+log_bals(struct bond *bond, const struct ovs_list *bals)
OVS_REQ_RDLOCK(rwlock)
{
if (VLOG_IS_DBG_ENABLED()) {
/* Inserts 'slave' into 'bals' so that descending order of 'tx_bytes' is
* maintained. */
static void
-insert_bal(struct list *bals, struct bond_slave *slave)
+insert_bal(struct ovs_list *bals, struct bond_slave *slave)
{
struct bond_slave *pos;
/* Removes 'slave' from its current list and then inserts it into 'bals' so
* that descending order of 'tx_bytes' is maintained. */
static void
-reinsert_bal(struct list *bals, struct bond_slave *slave)
+reinsert_bal(struct ovs_list *bals, struct bond_slave *slave)
{
list_remove(&slave->bal_node);
insert_bal(bals, slave);
{
struct bond_slave *slave;
struct bond_entry *e;
- struct list bals;
+ struct ovs_list bals;
bool rebalanced = false;
bool use_recirc;
static struct bond_slave *
get_enabled_slave(struct bond *bond)
{
- struct list *node;
+ struct ovs_list *node;
ovs_mutex_lock(&bond->mutex);
if (list_is_empty(&bond->enabled_slaves)) {
enum bundle_state state;
/* List of 'struct bundle_message's */
- struct list msg_list;
+ struct ovs_list msg_list;
};
struct bundle_message {
struct ofp_header *msg;
- struct list node; /* Element in 'struct ofp_bundles's msg_list */
+ struct ovs_list node; /* Element in 'struct ofp_bundles's msg_list */
};
static uint32_t
struct ofconn {
/* Configuration that persists from one connection to the next. */
- struct list node; /* In struct connmgr's "all_conns" list. */
+ struct ovs_list node; /* In struct connmgr's "all_conns" list. */
struct hmap_node hmap_node; /* In struct connmgr's "controllers" map. */
struct connmgr *connmgr; /* Connection's manager. */
*
* When 'updates' is nonempty, 'sent_abbrev_update' is true if 'updates'
* contains an update event of type NXFME_ABBREV and false otherwise.. */
- struct list updates OVS_GUARDED_BY(ofproto_mutex);
+ struct ovs_list updates OVS_GUARDED_BY(ofproto_mutex);
bool sent_abbrev_update OVS_GUARDED_BY(ofproto_mutex);
/* Active bundles. Contains "struct ofp_bundle"s. */
static void ofconn_send(const struct ofconn *, struct ofpbuf *,
struct rconn_packet_counter *);
-static void do_send_packet_ins(struct ofconn *, struct list *txq);
+static void do_send_packet_ins(struct ofconn *, struct ovs_list *txq);
/* A listener for incoming OpenFlow "service" connections. */
struct ofservice {
char *local_port_name;
/* OpenFlow connections. */
- struct hmap controllers; /* All OFCONN_PRIMARY controllers. */
- struct list all_conns; /* All controllers. */
+ struct hmap controllers; /* All OFCONN_PRIMARY controllers. */
+ struct ovs_list all_conns; /* All controllers. */
uint64_t master_election_id; /* monotonically increasing sequence number
* for master election */
bool master_election_id_defined;
/* Sends each of the messages in list 'replies' on 'ofconn' in order,
* accounting them as replies. */
void
-ofconn_send_replies(const struct ofconn *ofconn, struct list *replies)
+ofconn_send_replies(const struct ofconn *ofconn, struct ovs_list *replies)
{
struct ofpbuf *reply, *next;
size_t i;
for (i = 0; i < N_SCHEDULERS; i++) {
- struct list txq;
+ struct ovs_list txq;
pinsched_run(ofconn->schedulers[i], &txq);
do_send_packet_ins(ofconn, &txq);
}
static void
-do_send_packet_ins(struct ofconn *ofconn, struct list *txq)
+do_send_packet_ins(struct ofconn *ofconn, struct ovs_list *txq)
{
struct ofpbuf *pin, *next_pin;
{
struct connmgr *mgr = ofconn->connmgr;
uint16_t controller_max_len;
- struct list txq;
+ struct ovs_list txq;
pin.up.total_len = pin.up.packet_len;
struct rule_collection rules;
struct ofpbuf *resumed;
struct ofmonitor *m;
- struct list msgs;
+ struct ovs_list msgs;
rule_collection_init(&rules);
HMAP_FOR_EACH (m, ofconn_node, &ofconn->monitors) {
/* A packet_in, with extra members to assist in queuing and routing it. */
struct ofproto_packet_in {
struct ofputil_packet_in up;
- struct list list_node; /* For queuing. */
+ struct ovs_list list_node; /* For queuing. */
uint16_t controller_id; /* Controller ID to send to. */
int send_len; /* Length that the action requested sending. */
enum ofproto_packet_in_miss_type miss_type;
uint32_t *slave_masks);
void ofconn_send_reply(const struct ofconn *, struct ofpbuf *);
-void ofconn_send_replies(const struct ofconn *, struct list *);
+void ofconn_send_replies(const struct ofconn *, struct ovs_list *);
void ofconn_send_error(const struct ofconn *, const struct ofp_header *request,
enum ofperr);
struct rule_collection *)
OVS_REQUIRES(ofproto_mutex);
void ofmonitor_compose_refresh_updates(struct rule_collection *rules,
- struct list *msgs)
+ struct ovs_list *msgs)
OVS_REQUIRES(ofproto_mutex);
#endif /* connmgr.h */
uint32_t seq_number;
time_t last_template_set_time;
struct hmap cache_flow_key_map; /* ipfix_flow_cache_entry. */
- struct list cache_flow_start_timestamp_list; /* ipfix_flow_cache_entry. */
+ struct ovs_list cache_flow_start_timestamp_list; /* ipfix_flow_cache_entry. */
uint32_t cache_active_timeout; /* In seconds. */
uint32_t cache_max_flows;
};
/* Flow cache entry. */
struct ipfix_flow_cache_entry {
struct hmap_node flow_key_map_node;
- struct list cache_flow_start_timestamp_list_node;
+ struct ovs_list cache_flow_start_timestamp_list_node;
struct ipfix_flow_key flow_key;
/* Common aggregated elements. */
uint64_t flow_start_timestamp_usec;
* 'ofport_dpif'. Note, the pointed object is not protected, so
* users should always use the mport_find() to convert it to 'mport'. */
struct send_soon_entry {
- struct list list_node; /* In send_soon. */
+ struct ovs_list list_node; /* In send_soon. */
const struct ofport_dpif *ofport;
};
* them.
*/
struct udpif {
- struct list list_node; /* In all_udpifs list. */
+ struct ovs_list list_node; /* In all_udpifs list. */
struct dpif *dpif; /* Datapath handle. */
struct dpif_backer *backer; /* Opaque dpif_backer pointer. */
};
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
-static struct list all_udpifs = LIST_INITIALIZER(&all_udpifs);
+static struct ovs_list all_udpifs = LIST_INITIALIZER(&all_udpifs);
static size_t recv_upcalls(struct handler *);
static int process_upcall(struct udpif *, struct upcall *,
struct hmap_node hmap_node; /* Node in global 'xbridges' map. */
struct ofproto_dpif *ofproto; /* Key in global 'xbridges' map. */
- struct list xbundles; /* Owned xbundles. */
+ struct ovs_list xbundles; /* Owned xbundles. */
struct hmap xports; /* Indexed by ofp_port. */
char *name; /* Name used in log messages. */
struct hmap_node hmap_node; /* In global 'xbundles' map. */
struct ofbundle *ofbundle; /* Key in global 'xbundles' map. */
- struct list list_node; /* In parent 'xbridges' list. */
+ struct ovs_list list_node; /* In parent 'xbridges' list. */
struct xbridge *xbridge; /* Parent xbridge. */
- struct list xports; /* Contains "struct xport"s. */
+ struct ovs_list xports; /* Contains "struct xport"s. */
char *name; /* Name used in log messages. */
struct bond *bond; /* Nonnull iff more than one port. */
odp_port_t odp_port; /* Datapath port number or ODPP_NONE. */
- struct list bundle_node; /* In parent xbundle (if it exists). */
+ struct ovs_list bundle_node; /* In parent xbundle (if it exists). */
struct xbundle *xbundle; /* Parent xbundle or null. */
struct netdev *netdev; /* 'ofport''s netdev. */
const struct group_dpif *group, int depth)
{
struct ofputil_bucket *bucket;
- const struct list *buckets;
+ const struct ovs_list *buckets;
group_dpif_get_buckets(group, &buckets);
LIST_FOR_EACH (bucket, list_node, buckets) {
int i = 0;
struct ofputil_bucket *bucket;
- const struct list *buckets;
+ const struct ovs_list *buckets;
group_dpif_get_buckets(group, &buckets);
LIST_FOR_EACH (bucket, list_node, buckets) {
xlate_all_group(struct xlate_ctx *ctx, struct group_dpif *group)
{
struct ofputil_bucket *bucket;
- const struct list *buckets;
+ const struct ovs_list *buckets;
struct flow old_flow = ctx->xin->flow;
group_dpif_get_buckets(group, &buckets);
char *name; /* Identifier for log messages. */
/* Configuration. */
- struct list ports; /* Contains "struct ofport"s. */
+ struct ovs_list ports; /* Contains "struct ofport"s. */
enum port_vlan_mode vlan_mode; /* VLAN mode */
int vlan; /* -1=trunk port, else a 12-bit VLAN ID. */
unsigned long *trunks; /* Bitmap of trunked VLANs, if 'vlan' == -1.
odp_port_t odp_port;
struct ofbundle *bundle; /* Bundle that contains this port, if any. */
- struct list bundle_node; /* In struct ofbundle's "ports" list. */
+ struct ovs_list bundle_node;/* In struct ofbundle's "ports" list. */
struct cfm *cfm; /* Connectivity Fault Management, if any. */
struct bfd *bfd; /* BFD, if any. */
bool may_enable; /* May be enabled in bonds. */
/* Datapath port slated for removal from datapath. */
struct odp_garbage {
- struct list list_node;
+ struct ovs_list list_node;
odp_port_t odp_port;
};
struct dpif_port_dump port_dump;
struct dpif_port port;
struct shash_node *node;
- struct list garbage_list;
+ struct ovs_list garbage_list;
struct odp_garbage *garbage, *next;
struct sset names;
struct ofproto_packet_in *pin, *next_pin;
struct rule_dpif *rule;
struct oftable *table;
- struct list pins;
+ struct ovs_list pins;
ofproto->backer->need_revalidate = REV_RECONFIGURE;
xlate_txn_start();
* waiting for flow restore to complete. */
if (!ofproto_get_flow_restore_wait()) {
struct ofproto_packet_in *pin, *next_pin;
- struct list pins;
+ struct ovs_list pins;
guarded_list_pop_all(&ofproto->pins, &pins);
LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &pins) {
struct ofpbuf *learning_packet;
int error, n_packets, n_errors;
struct mac_entry *e;
- struct list packets;
+ struct ovs_list packets;
list_init(&packets);
ovs_rwlock_rdlock(&ofproto->ml->rwlock);
OVS_REQUIRES(group->stats_mutex)
{
struct ofputil_bucket *bucket;
- const struct list *buckets;
+ const struct ovs_list *buckets;
group->packet_count = 0;
group->byte_count = 0;
bucket->stats.packet_count += stats->n_packets;
bucket->stats.byte_count += stats->n_bytes;
} else { /* Credit to all buckets */
- const struct list *buckets;
+ const struct ovs_list *buckets;
group_dpif_get_buckets(group, &buckets);
LIST_FOR_EACH (bucket, list_node, buckets) {
{
struct group_dpif *group = group_dpif_cast(group_);
struct ofputil_bucket *bucket;
- const struct list *buckets;
+ const struct ovs_list *buckets;
struct bucket_counter *bucket_stats;
ovs_mutex_lock(&group->stats_mutex);
void
group_dpif_get_buckets(const struct group_dpif *group,
- const struct list **buckets)
+ const struct ovs_list **buckets)
{
*buckets = &group->up.buckets;
}
struct group_dpif **group);
void group_dpif_get_buckets(const struct group_dpif *group,
- const struct list **buckets);
+ const struct ovs_list **buckets);
enum ofp11_group_type group_dpif_get_type(const struct group_dpif *group);
bool ofproto_has_vlan_splinters(const struct ofproto_dpif *);
struct hmap learned_cookies OVS_GUARDED_BY(ofproto_mutex);
/* List of expirable flows, in all flow tables. */
- struct list expirable OVS_GUARDED_BY(ofproto_mutex);
+ struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex);
/* Meter table.
* OpenFlow meters start at 1. To avoid confusion we leave the first
OVSRCU_TYPE(const struct rule_actions *) actions;
/* In owning meter's 'rules' list. An empty list if there is no meter. */
- struct list meter_list_node OVS_GUARDED_BY(ofproto_mutex);
+ struct ovs_list meter_list_node OVS_GUARDED_BY(ofproto_mutex);
/* Flow monitors (e.g. for NXST_FLOW_MONITOR, related to struct ofmonitor).
*
/* Optimisation for flow expiry. In ofproto's 'expirable' list if this
* rule is expirable, otherwise empty. */
- struct list expirable OVS_GUARDED_BY(ofproto_mutex);
+ struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex);
/* Times. Last so that they are more likely close to the stats managed
* by the provider. */
const long long int created; /* Creation time. */
const long long int modified; /* Time of last modification. */
- struct list buckets; /* Contains "struct ofputil_bucket"s. */
+ struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */
const uint32_t n_buckets;
};
* (We can't do this immediately from ofopgroup_complete() because that holds
* ofproto_mutex, which rule_execute() needs released.) */
struct rule_execute {
- struct list list_node; /* In struct ofproto's "rule_executes" list. */
+ struct ovs_list list_node; /* In struct ofproto's "rule_executes" list. */
struct rule *rule; /* Owns a reference to the rule. */
ofp_port_t in_port;
struct ofpbuf *packet; /* Owns the packet. */
struct hmap_node hmap_node OVS_GUARDED_BY(ofproto_mutex);
/* In 'dead_cookies' list when removed from hmap. */
- struct list list_node;
+ struct ovs_list list_node;
} u;
/* Key. */
static void learned_cookies_inc(struct ofproto *, const struct rule_actions *)
OVS_REQUIRES(ofproto_mutex);
static void learned_cookies_dec(struct ofproto *, const struct rule_actions *,
- struct list *dead_cookies)
+ struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex);
-static void learned_cookies_flush(struct ofproto *, struct list *dead_cookies)
+static void learned_cookies_flush(struct ofproto *, struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex);
/* ofport. */
OVS_EXCLUDED(ofproto_mutex)
{
struct rule_execute *e, *next;
- struct list executes;
+ struct ovs_list executes;
guarded_list_pop_all(&ofproto->rule_executes, &executes);
LIST_FOR_EACH_SAFE (e, next, list_node, &executes) {
destroy_rule_executes(struct ofproto *ofproto)
{
struct rule_execute *e, *next;
- struct list executes;
+ struct ovs_list executes;
guarded_list_pop_all(&ofproto->rule_executes, &executes);
LIST_FOR_EACH_SAFE (e, next, list_node, &executes) {
static void
learned_cookies_update_one__(struct ofproto *ofproto,
const struct ofpact_learn *learn,
- int delta, struct list *dead_cookies)
+ int delta, struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex)
{
uint32_t hash = hash_learned_cookie(learn->cookie, learn->table_id);
static void
learned_cookies_update__(struct ofproto *ofproto,
const struct rule_actions *actions,
- int delta, struct list *dead_cookies)
+ int delta, struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex)
{
if (actions->has_learn_with_delete) {
static void
learned_cookies_dec(struct ofproto *ofproto,
const struct rule_actions *actions,
- struct list *dead_cookies)
+ struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex)
{
learned_cookies_update__(ofproto, actions, -1, dead_cookies);
}
static void
-learned_cookies_flush(struct ofproto *ofproto, struct list *dead_cookies)
+learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex)
{
struct learned_cookie *c, *next;
{
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
struct ofputil_table_features *features;
- struct list replies;
+ struct ovs_list replies;
struct ofpbuf msg;
size_t i;
}
static void
-append_port_stat(struct ofport *port, struct list *replies)
+append_port_stat(struct ofport *port, struct ovs_list *replies)
{
struct ofputil_port_stats ops = { .port_no = port->pp.port_no };
static void
handle_port_request(struct ofconn *ofconn,
const struct ofp_header *request, ofp_port_t port_no,
- void (*cb)(struct ofport *, struct list *replies))
+ void (*cb)(struct ofport *, struct ovs_list *replies))
{
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
struct ofport *port;
- struct list replies;
+ struct ovs_list replies;
ofpmp_init(&replies, request);
if (port_no != OFPP_ANY) {
}
static void
-append_port_desc(struct ofport *port, struct list *replies)
+append_port_desc(struct ofport *port, struct ovs_list *replies)
{
ofputil_append_port_desc_stats_reply(&port->pp, replies);
}
struct ofputil_flow_stats_request fsr;
struct rule_criteria criteria;
struct rule_collection rules;
- struct list replies;
+ struct ovs_list replies;
enum ofperr error;
size_t i;
struct queue_stats_cbdata {
struct ofport *ofport;
- struct list replies;
+ struct ovs_list replies;
long long int now;
};
const struct flow_mod_requester *req)
OVS_REQUIRES(ofproto_mutex)
{
- struct list dead_cookies = LIST_INITIALIZER(&dead_cookies);
+ struct ovs_list dead_cookies = LIST_INITIALIZER(&dead_cookies);
enum nx_flow_update_event event;
size_t i;
OVS_REQUIRES(ofproto_mutex)
{
if (rules->n) {
- struct list dead_cookies = LIST_INITIALIZER(&dead_cookies);
+ struct ovs_list dead_cookies = LIST_INITIALIZER(&dead_cookies);
struct ofproto *ofproto = rules->rules[0]->ofproto;
struct rule *rule, *next;
size_t i;
static void
ofproto_compose_flow_refresh_update(const struct rule *rule,
enum nx_flow_monitor_flags flags,
- struct list *msgs)
+ struct ovs_list *msgs)
OVS_REQUIRES(ofproto_mutex)
{
const struct rule_actions *actions;
void
ofmonitor_compose_refresh_updates(struct rule_collection *rules,
- struct list *msgs)
+ struct ovs_list *msgs)
OVS_REQUIRES(ofproto_mutex)
{
size_t i;
struct ofmonitor **monitors;
size_t n_monitors, allocated_monitors;
struct rule_collection rules;
- struct list replies;
+ struct ovs_list replies;
enum ofperr error;
struct ofpbuf b;
size_t i;
*/
struct meter {
long long int created; /* Time created. */
- struct list rules; /* List of "struct rule_dpif"s. */
+ struct ovs_list rules; /* List of "struct rule_dpif"s. */
ofproto_meter_id provider_meter_id;
uint16_t flags; /* Meter flags. */
uint16_t n_bands; /* Number of meter bands. */
enum ofptype type)
{
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
- struct list replies;
+ struct ovs_list replies;
uint64_t bands_stub[256 / 8];
struct ofpbuf bands;
uint32_t meter_id, first, last;
}
static void
-append_group_stats(struct ofgroup *group, struct list *replies)
+append_group_stats(struct ofgroup *group, struct ovs_list *replies)
{
struct ofputil_group_stats ogs;
const struct ofproto *ofproto = group->ofproto;
static void
handle_group_request(struct ofconn *ofconn,
const struct ofp_header *request, uint32_t group_id,
- void (*cb)(struct ofgroup *, struct list *replies))
+ void (*cb)(struct ofgroup *, struct ovs_list *replies))
{
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
struct ofgroup *group;
- struct list replies;
+ struct ovs_list replies;
ofpmp_init(&replies, request);
if (group_id == OFPG_ALL) {
}
static void
-append_group_desc(struct ofgroup *group, struct list *replies)
+append_group_desc(struct ofgroup *group, struct ovs_list *replies)
{
struct ofputil_group_desc gds;
struct pinqueue {
struct hmap_node node; /* In struct pinsched's 'queues' hmap. */
- ofp_port_t port_no; /* Port number. */
- struct list packets; /* Contains "struct ofpbuf"s. */
+ ofp_port_t port_no; /* Port number. */
+ struct ovs_list packets; /* Contains "struct ofpbuf"s. */
int n; /* Number of packets in 'packets'. */
};
void
pinsched_send(struct pinsched *ps, ofp_port_t port_no,
- struct ofpbuf *packet, struct list *txq)
+ struct ofpbuf *packet, struct ovs_list *txq)
{
list_init(txq);
if (!ps) {
}
void
-pinsched_run(struct pinsched *ps, struct list *txq)
+pinsched_run(struct pinsched *ps, struct ovs_list *txq)
{
list_init(txq);
if (ps) {
#include <stdint.h>
#include "flow.h"
-struct list;
+struct ovs_list;
struct ofpbuf;
struct pinsched *pinsched_create(int rate_limit, int burst_limit);
void pinsched_set_limits(struct pinsched *, int rate_limit, int burst_limit);
void pinsched_destroy(struct pinsched *);
void pinsched_send(struct pinsched *, ofp_port_t port_no, struct ofpbuf *,
- struct list *txq);
-void pinsched_run(struct pinsched *, struct list *txq);
+ struct ovs_list *txq);
+void pinsched_run(struct pinsched *, struct ovs_list *txq);
void pinsched_wait(struct pinsched *);
struct pinsched_stats {
struct ovsdb_jsonrpc_remote {
struct ovsdb_jsonrpc_server *server;
struct pstream *listener; /* Listener, if passive. */
- struct list sessions; /* List of "struct ovsdb_jsonrpc_session"s. */
+ struct ovs_list sessions; /* List of "struct ovsdb_jsonrpc_session"s. */
uint8_t dscp;
};
/* JSON-RPC database server session. */
struct ovsdb_jsonrpc_session {
- struct list node; /* Element in remote's sessions list. */
+ struct ovs_list node; /* Element in remote's sessions list. */
struct ovsdb_session up;
struct ovsdb_jsonrpc_remote *remote;
/* Database. */
struct ovsdb {
struct ovsdb_schema *schema;
- struct list replicas; /* Contains "struct ovsdb_replica"s. */
+ struct ovs_list replicas; /* Contains "struct ovsdb_replica"s. */
struct shash tables; /* Contains "struct ovsdb_table *"s. */
/* Triggers. */
- struct list triggers; /* Contains "struct ovsdb_trigger"s. */
+ struct ovs_list triggers; /* Contains "struct ovsdb_trigger"s. */
bool run_triggers;
};
/* Database replication. */
struct ovsdb_replica {
- struct list node; /* Element in "struct ovsdb" replicas list. */
+ struct ovs_list node; /* Element in "struct ovsdb" replicas list. */
const struct ovsdb_replica_class *class;
};
* ovsdb_weak_ref" structures are created for them.
*/
struct ovsdb_weak_ref {
- struct list src_node; /* In src->src_refs list. */
- struct list dst_node; /* In destination row's dst_refs list. */
+ struct ovs_list src_node; /* In src->src_refs list. */
+ struct ovs_list dst_node; /* In destination row's dst_refs list. */
struct ovsdb_row *src; /* Source row. */
};
struct ovsdb_txn_row *txn_row; /* Transaction that row is in, if any. */
/* Weak references. */
- struct list src_refs; /* Weak references from this row. */
- struct list dst_refs; /* Weak references to this row. */
+ struct ovs_list src_refs; /* Weak references from this row. */
+ struct ovs_list dst_refs; /* Weak references to this row. */
/* Number of strong refs to this row from other rows, in this table or
* other tables, through 'uuid' columns that have a 'refTable' constraint
* (e.g. jsonrpc-server.c) embed this in a larger data structure. */
struct ovsdb_session {
struct ovsdb_server *server;
- struct list completions; /* Completed triggers. */
+ struct ovs_list completions;/* Completed triggers. */
struct hmap waiters; /* "ovsdb_lock_waiter *"s by lock name. */
};
struct hmap_node hmap_node; /* In ovsdb_server's "locks" hmap. */
struct ovsdb_server *server; /* The containing server. */
char *name; /* Unique name. */
- struct list waiters; /* Contains "struct ovsdb_lock_waiter"s. */
+ struct ovs_list waiters; /* Contains "struct ovsdb_lock_waiter"s. */
};
struct ovsdb_lock_waiter *ovsdb_lock_get_owner(const struct ovsdb_lock *);
char *lock_name;
struct ovsdb_session *session;
- struct list lock_node; /* In ->lock->waiters's list. */
+ struct ovs_list lock_node; /* In ->lock->waiters's list. */
};
struct ovsdb_session *ovsdb_lock_waiter_remove(struct ovsdb_lock_waiter *);
struct ovsdb_txn {
struct ovsdb *db;
- struct list txn_tables; /* Contains "struct ovsdb_txn_table"s. */
+ struct ovs_list txn_tables; /* Contains "struct ovsdb_txn_table"s. */
struct ds comment;
};
/* A table modified by a transaction. */
struct ovsdb_txn_table {
- struct list node; /* Element in ovsdb_txn's txn_tables list. */
+ struct ovs_list node; /* Element in ovsdb_txn's txn_tables list. */
struct ovsdb_table *table;
struct hmap txn_rows; /* Contains "struct ovsdb_txn_row"s. */
struct ovsdb_trigger {
struct ovsdb_session *session; /* Session that owns this trigger. */
struct ovsdb *db; /* Database on which trigger acts. */
- struct list node; /* !result: in db->triggers;
+ struct ovs_list node; /* !result: in db->triggers;
* result: in session->completions. */
struct json *request; /* Database request. */
struct json *result; /* Result (null if none yet). */
/* Sample list element. */
struct element {
int value;
- struct list node;
+ struct ovs_list node;
};
/* Puts the 'n' values in 'values' into 'elements', and then puts those
* elements in order into 'list'. */
static void
-make_list(struct list *list, struct element elements[],
+make_list(struct ovs_list *list, struct element elements[],
int values[], size_t n)
{
size_t i;
/* Verifies that 'list' contains exactly the 'n' values in 'values', in the
* specified order. */
static void
-check_list(struct list *list, const int values[], size_t n)
+check_list(struct ovs_list *list, const int values[], size_t n)
{
struct element *e;
size_t i;
#if 0
/* Prints the values in 'list', plus 'name' as a title. */
static void
-print_list(const char *name, struct list *list)
+print_list(const char *name, struct ovs_list *list)
{
struct element *e;
for (n = 0; n <= MAX_ELEMS; n++) {
struct element elements[MAX_ELEMS];
int values[MAX_ELEMS];
- struct list list;
+ struct ovs_list list;
make_list(&list, elements, values, n);
check_list(&list, values, n);
for (pattern = 0; pattern < 1ul << n; pattern++) {
struct element elements[MAX_ELEMS];
int values[MAX_ELEMS];
- struct list list;
+ struct ovs_list list;
struct element *e, *next;
size_t values_idx, n_remaining;
int i;
*
* Destroys all of the 'requests'. */
static void
-transact_multiple_noreply(struct vconn *vconn, struct list *requests)
+transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests)
{
struct ofpbuf *request, *reply;
static void
transact_noreply(struct vconn *vconn, struct ofpbuf *request)
{
- struct list requests;
+ struct ovs_list requests;
list_init(&requests);
list_push_back(&requests, &request->list_node);
static void
fte_make_flow_mod(const struct fte *fte, int index, uint16_t command,
- enum ofputil_protocol protocol, struct list *packets)
+ enum ofputil_protocol protocol, struct ovs_list *packets)
{
const struct fte_version *version = fte->versions[index];
struct ofputil_flow_mod fm;
enum { FILE_IDX = 0, SWITCH_IDX = 1 };
enum ofputil_protocol usable_protocols, protocol;
struct classifier cls;
- struct list requests;
+ struct ovs_list requests;
struct vconn *vconn;
struct fte *fte;
struct vsctl_bridge {
struct ovsrec_bridge *br_cfg;
char *name;
- struct list ports; /* Contains "struct vsctl_port"s. */
+ struct ovs_list ports; /* Contains "struct vsctl_port"s. */
/* VLAN ("fake") bridge support.
*
};
struct vsctl_port {
- struct list ports_node; /* In struct vsctl_bridge's 'ports' list. */
- struct list ifaces; /* Contains "struct vsctl_iface"s. */
+ struct ovs_list ports_node; /* In struct vsctl_bridge's 'ports' list. */
+ struct ovs_list ifaces; /* Contains "struct vsctl_iface"s. */
struct ovsrec_port *port_cfg;
struct vsctl_bridge *bridge;
};
struct vsctl_iface {
- struct list ifaces_node; /* In struct vsctl_port's 'ifaces' list. */
+ struct ovs_list ifaces_node; /* In struct vsctl_port's 'ifaces' list. */
struct ovsrec_interface *iface_cfg;
struct vsctl_port *port;
};
*
* They are immutable: they never change between iface_create() and
* iface_destroy(). */
- struct list port_elem; /* Element in struct port's "ifaces" list. */
+ struct ovs_list port_elem; /* Element in struct port's "ifaces" list. */
struct hmap_node name_node; /* In struct bridge's "iface_by_name" hmap. */
struct hmap_node ofp_port_node; /* In struct bridge's "ifaces" hmap. */
struct port *port; /* Containing port. */
/* An ordinary bridge port has 1 interface.
* A bridge port for bonding has at least 2 interfaces. */
- struct list ifaces; /* List of "struct iface"s. */
+ struct ovs_list ifaces; /* List of "struct iface"s. */
};
struct bridge {
struct vtep_ctl_pswitch {
const struct vteprec_physical_switch *ps_cfg;
char *name;
- struct list ports; /* Contains "struct vteprec_physical_port"s. */
+ struct ovs_list ports; /* Contains "struct vteprec_physical_port"s. */
};
struct vtep_ctl_port {
- struct list ports_node; /* In struct vtep_ctl_pswitch's 'ports' list. */
+ struct ovs_list ports_node; /* In struct vtep_ctl_pswitch's 'ports' list. */
const struct vteprec_physical_port *port_cfg;
struct vtep_ctl_pswitch *ps;
struct shash bindings; /* Maps from vlan to vtep_ctl_lswitch. */
const struct vteprec_mcast_macs_remote *remote_cfg;
const struct vteprec_physical_locator_set *ploc_set_cfg;
- struct list locators; /* Contains 'vtep_ctl_ploc's. */
+ struct ovs_list locators; /* Contains 'vtep_ctl_ploc's. */
};
struct vtep_ctl_ploc {
- struct list locators_node; /* In struct vtep_ctl_ploc_set's 'locators'
- list. */
+ struct ovs_list locators_node; /* In struct vtep_ctl_ploc_set's 'locators'
+ list. */
const struct vteprec_physical_locator *ploc_cfg;
};