X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fstp.h;h=c0175cdbf36752d69c04adb67f005d7065397cb4;hb=HEAD;hp=54f7f5b4527a75bcab3f4e0ca63804a5c16103d7;hpb=3310b5708bfb066986de399aa27d922763a1cb2c;p=sliver-openvswitch.git diff --git a/lib/stp.h b/lib/stp.h index 54f7f5b45..c0175cdbf 100644 --- a/lib/stp.h +++ b/lib/stp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011 Nicira Networks. + * Copyright (c) 2008, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,11 +55,13 @@ typedef uint64_t stp_identifier; /* Basic STP functionality. */ #define STP_MAX_PORTS 255 +void stp_init(void); struct stp *stp_create(const char *name, stp_identifier bridge_id, void (*send_bpdu)(struct ofpbuf *bpdu, int port_no, void *aux), void *aux); -void stp_destroy(struct stp *); +struct stp *stp_ref(const struct stp *); +void stp_unref(struct stp *); void stp_tick(struct stp *, int ms); void stp_set_bridge_id(struct stp *, stp_identifier bridge_id); void stp_set_bridge_priority(struct stp *, uint16_t new_priority); @@ -76,6 +78,7 @@ int stp_get_root_path_cost(const struct stp *); int stp_get_hello_time(const struct stp *); int stp_get_max_age(const struct stp *); int stp_get_forward_delay(const struct stp *); +bool stp_check_and_reset_fdb_flush(struct stp *); /* Obtaining STP ports. */ struct stp_port *stp_get_port(struct stp *, int port_no); @@ -117,6 +120,7 @@ enum stp_state { const char *stp_state_name(enum stp_state); bool stp_forward_in_state(enum stp_state); bool stp_learn_in_state(enum stp_state); +bool stp_listen_in_state(enum stp_state); /* Role of an STP port. */ enum stp_role { @@ -136,6 +140,8 @@ int stp_port_no(const struct stp_port *); int stp_port_get_id(const struct stp_port *); enum stp_state stp_port_get_state(const struct stp_port *); enum stp_role stp_port_get_role(const struct stp_port *); +void stp_port_get_counts(const struct stp_port *, + int *tx_count, int *rx_count, int *error_count); void stp_port_enable(struct stp_port *); void stp_port_disable(struct stp_port *); void stp_port_set_priority(struct stp_port *, uint8_t new_priority);