~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/dpif-provider.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
 
2
 * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
3
3
 *
4
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
5
 * you may not use this file except in compliance with the License.
127
127
     * port number.  Returns EBUSY if caller attempted to choose a port
128
128
     * number, and it was in use. */
129
129
    int (*port_add)(struct dpif *dpif, struct netdev *netdev,
130
 
                    uint32_t *port_no);
 
130
                    odp_port_t *port_no);
131
131
 
132
132
    /* Removes port numbered 'port_no' from 'dpif'. */
133
 
    int (*port_del)(struct dpif *dpif, uint32_t port_no);
 
133
    int (*port_del)(struct dpif *dpif, odp_port_t port_no);
134
134
 
135
135
    /* Queries 'dpif' for a port with the given 'port_no' or 'devname'.
136
136
     * If 'port' is not null, stores information about the port into
139
139
     * If 'port' is not null, the caller takes ownership of data in
140
140
     * 'port' and must free it with dpif_port_destroy() when it is no
141
141
     * longer needed. */
142
 
    int (*port_query_by_number)(const struct dpif *dpif, uint32_t port_no,
 
142
    int (*port_query_by_number)(const struct dpif *dpif, odp_port_t port_no,
143
143
                                struct dpif_port *port);
144
144
    int (*port_query_by_name)(const struct dpif *dpif, const char *devname,
145
145
                              struct dpif_port *port);
146
146
 
147
147
    /* Returns one greater than the largest port number accepted in flow
148
148
     * actions. */
149
 
    int (*get_max_ports)(const struct dpif *dpif);
 
149
    odp_port_t (*get_max_ports)(const struct dpif *dpif);
150
150
 
151
151
    /* Returns the Netlink PID value to supply in OVS_ACTION_ATTR_USERSPACE
152
152
     * actions as the OVS_USERSPACE_ATTR_PID attribute's value, for use in
162
162
     *
163
163
     * A dpif provider that doesn't have meaningful Netlink PIDs can use NULL
164
164
     * for this function.  This is equivalent to always returning 0. */
165
 
    uint32_t (*port_get_pid)(const struct dpif *dpif, uint32_t port_no);
 
165
    uint32_t (*port_get_pid)(const struct dpif *dpif, odp_port_t port_no);
166
166
 
167
167
    /* Attempts to begin dumping the ports in a dpif.  On success, returns 0
168
168
     * and initializes '*statep' with any data needed for iteration.  On
279
279
     * called again once it returns nonzero within a given iteration (but the
280
280
     * 'flow_dump_done' function will be called afterward).
281
281
     *
282
 
     * On success, if 'key' and 'key_len' are nonnull then '*key' and
283
 
     * '*key_len' must be set to Netlink attributes with types OVS_KEY_ATTR_*
284
 
     * representing the dumped flow's key.  If 'actions' and 'actions_len' are
285
 
     * nonnull then they should be set to Netlink attributes with types
286
 
     * OVS_ACTION_ATTR_* representing the dumped flow's actions.  If 'stats'
287
 
     * is nonnull then it should be set to the dumped flow's statistics.
 
282
     * On success:
 
283
     *
 
284
     *     - If 'key' and 'key_len' are nonnull, then '*key' and '*key_len'
 
285
     *       must be set to Netlink attributes with types OVS_KEY_ATTR_*
 
286
     *       representing the dumped flow's key.
 
287
     *
 
288
     *     - If 'mask' and 'mask_len' are nonnull then '*mask' and '*mask_len'
 
289
     *       must be set to Netlink attributes with types of OVS_KEY_ATTR_*
 
290
     *       representing the dumped flow's mask.
 
291
     *
 
292
     *     - If 'actions' and 'actions_len' are nonnull then they should be set
 
293
     *       to Netlink attributes with types OVS_ACTION_ATTR_* representing
 
294
     *       the dumped flow's actions.
 
295
     *
 
296
     *     - If 'stats' is nonnull then it should be set to the dumped flow's
 
297
     *       statistics.
288
298
     *
289
299
     * All of the returned data is owned by 'dpif', not by the caller, and the
290
300
     * caller must not modify or free it.  'dpif' must guarantee that it
292
302
     * 'flow_dump_next' or 'flow_dump_done' for 'state'. */
293
303
    int (*flow_dump_next)(const struct dpif *dpif, void *state,
294
304
                          const struct nlattr **key, size_t *key_len,
 
305
                          const struct nlattr **mask, size_t *mask_len,
295
306
                          const struct nlattr **actions, size_t *actions_len,
296
307
                          const struct dpif_flow_stats **stats);
297
308