libnl
3.2.21
|
Data Structures | |
struct | ovs_dp |
Open vSwitch datapath object. More... |
Enumerations | |
enum | ovs_dp_stat_id_t { OVS_DP_STAT_HIT, OVS_DP_STAT_MISSED, OVS_DP_STAT_LOST, OVS_DP_STAT_FLOWS, __OVS_DP_STAT_MAX } |
Datapath statistic identifiers. |
Retrieving and Lookup | |
int | ovs_dp_alloc_cache (struct nl_sock *sk, struct nl_cache **result) |
Allocate cache and fill it with all configured datapaths. | |
struct ovs_dp * | ovs_dp_lookup (struct nl_cache *cache, const char *name) |
Lookup datpath by name. |
Addition / Deletion | |
int | ovs_dp_build_add_request (const struct ovs_dp *dp, int flags, struct nl_msg **result) |
Build Generic Netlink message requesting addition of OVS datapath. | |
int | ovs_dp_add (struct nl_sock *sk, const struct ovs_dp *dp, int flags) |
Add OVS datapath. | |
int | ovs_dp_build_delete_request (const struct ovs_dp *dp, int flags, struct nl_msg **result) |
Build Generic Netlink message requesting deletion of OVS datapath. | |
int | ovs_dp_delete (struct nl_sock *sk, const struct ovs_dp *dp, int flags) |
Delete OVS datapath. |
Accessing Datapath Attributes | |
struct ovs_dp * | ovs_dp_alloc (void) |
Allocate Open vSwitch Datapath. | |
void | ovs_dp_put (struct ovs_dp *dp) |
Give up reference to a datpath object. | |
void | ovs_dp_set_name (struct ovs_dp *dp, const char *name) |
Set datpath name. | |
const char * | ovs_dp_get_name (const struct ovs_dp *dp) |
Return datpath name. | |
void | ovs_dp_set_ifindex (struct ovs_dp *dp, int ifindex) |
Set interface index of datapath port. | |
int | ovs_dp_get_ifindex (const struct ovs_dp *dp) |
Return interface index of datapath port. | |
void | ovs_dp_set_upcall_pid (struct ovs_dp *dp, int pid) |
Set upcall PID. | |
int | ovs_dp_get_upcall_pid (const struct ovs_dp *dp) |
Return upcall PID. |
Statistics | |
uint64_t | ovs_dp_get_stat (const struct ovs_dp *dp, ovs_dp_stat_id_t id) |
Return value of datapath statistics counter. | |
int | ovs_dp_set_stat (struct ovs_dp *dp, ovs_dp_stat_id_t id, const uint64_t value) |
Set value of datpath statistics counter. | |
const char * | ovs_dp_stat2str (ovs_dp_stat_id_t st, char *buf, size_t len) |
Translate datapath statistic ID to name. | |
int | ovs_dp_str2stat (const char *name) |
Translate datapath statistic name to identifier. |
int ovs_dp_alloc_cache | ( | struct nl_sock * | sk, |
struct nl_cache ** | result | ||
) |
Allocate cache and fill it with all configured datapaths.
sk | Netlink socket. |
result | Pointer to store resulting cache. |
Allocates and initializes a new datpath cache. A netlink message is sent to the kernel requesting a full dump of all configured datpaths. The returned messages are parsed and filled into the cache.
Definition at line 195 of file datapath.c.
References nl_cache_alloc(), nl_cache_free(), and nl_cache_refill().
|
read |
Lookup datpath by name.
cache | Dapath cache |
name | Name of datapath |
Find a datapath in the cache matching the provided named.
Definition at line 227 of file datapath.c.
References nl_object_get().
int ovs_dp_build_add_request | ( | const struct ovs_dp * | dp, |
int | flags, | ||
struct nl_msg ** | result | ||
) |
Build Generic Netlink message requesting addition of OVS datapath.
dp | Datapath object |
flags | Additional netlink message flags (unused) |
result | Pointer to store resulting Netlink message |
Identical to ovs_dp_add() but returns message instead of sending it to the kernel.
Definition at line 364 of file datapath.c.
Referenced by ovs_dp_add().
int ovs_dp_add | ( | struct nl_sock * | sk, |
const struct ovs_dp * | dp, | ||
int | flags | ||
) |
Add OVS datapath.
sk | Netlink socket. |
dp | Datapath object |
flags | Additional netlink message flags (unused) |
Builds a Generic Netlink message with command OVS_DP_CMD_NEW
requesting the addition of a new Open vSwitch datapath and sends the message to the kernel.
After sending, the function will wait for the ACK or an eventual error message and thus blocks until the operation has been completed.
Definition at line 389 of file datapath.c.
References nl_send_sync(), and ovs_dp_build_add_request().
int ovs_dp_build_delete_request | ( | const struct ovs_dp * | dp, |
int | flags, | ||
struct nl_msg ** | result | ||
) |
Build Generic Netlink message requesting deletion of OVS datapath.
dp | Datapath object to delete |
flags | Additional netlink message flags (unused) |
result | Pointer to store resulting Netlink message |
Identical to ovs_dp_delete() but returns message instead of sending it to the kernel.
Definition at line 414 of file datapath.c.
Referenced by ovs_dp_delete().
int ovs_dp_delete | ( | struct nl_sock * | sk, |
const struct ovs_dp * | dp, | ||
int | flags | ||
) |
Delete OVS datapath.
sk | Netlink socket. |
dp | Datapath object |
flags | Additional netlink message flags (unused) |
Builds a Generic Netlink message with command OVS_DP_CMD_DEL
requesting the deletion of a new Open vSwitch datapath and sends the message to the kernel.
After sending, the function will wait for the ACK or an eventual error message and thus blocks until the operation has been completed.
Definition at line 439 of file datapath.c.
References nl_send_sync(), and ovs_dp_build_delete_request().
|
read |
Allocate Open vSwitch Datapath.
Definition at line 463 of file datapath.c.
References nl_object_alloc().
void ovs_dp_put | ( | struct ovs_dp * | dp | ) |
Give up reference to a datpath object.
dp | Datapath object |
Definition at line 472 of file datapath.c.
References nl_object_put().
void ovs_dp_set_name | ( | struct ovs_dp * | dp, |
const char * | name | ||
) |
Set datpath name.
dp | Datapath object |
name | New name |
Definition at line 485 of file datapath.c.
const char* ovs_dp_get_name | ( | const struct ovs_dp * | dp | ) |
Return datpath name.
dp | Datapath object |
Definition at line 498 of file datapath.c.
void ovs_dp_set_ifindex | ( | struct ovs_dp * | dp, |
int | ifindex | ||
) |
Set interface index of datapath port.
dp | Datapath object |
ifindex | Interface index |
Definition at line 510 of file datapath.c.
int ovs_dp_get_ifindex | ( | const struct ovs_dp * | dp | ) |
Return interface index of datapath port.
dp | Datapath object |
Definition at line 524 of file datapath.c.
void ovs_dp_set_upcall_pid | ( | struct ovs_dp * | dp, |
int | pid | ||
) |
Set upcall PID.
dp | Datapath object |
pid | Upcall PID |
Definition at line 536 of file datapath.c.
int ovs_dp_get_upcall_pid | ( | const struct ovs_dp * | dp | ) |
Return upcall PID.
dp | Datapath object |
Definition at line 550 of file datapath.c.
uint64_t ovs_dp_get_stat | ( | const struct ovs_dp * | dp, |
ovs_dp_stat_id_t | id | ||
) |
Return value of datapath statistics counter.
dp | Datapath object |
id | Identifier of statistical counter |
Definition at line 569 of file datapath.c.
int ovs_dp_set_stat | ( | struct ovs_dp * | dp, |
ovs_dp_stat_id_t | id, | ||
const uint64_t | value | ||
) |
Set value of datpath statistics counter.
dp | Datpath object |
id | Identifier of statistical counter |
value | New value |
Definition at line 588 of file datapath.c.
const char* ovs_dp_stat2str | ( | ovs_dp_stat_id_t | st, |
char * | buf, | ||
size_t | len | ||
) |
Translate datapath statistic ID to name.
st | Datapath statistic identifier |
buf | Buffer to store name |
len | Length of buffer |
Definition at line 615 of file datapath.c.
int ovs_dp_str2stat | ( | const char * | name | ) |
Translate datapath statistic name to identifier.
name | Name of datapath statistic identifier |
Definition at line 626 of file datapath.c.