These days P2P means peer-2-peer (also well known from serveral filesharing

protocols) while PointToPoint has been PtP links. Change the variables
accordingly while the code is still fresh and undocumented.

Requested by:	bz
This commit is contained in:
Andrew Thompson 2006-12-11 23:46:40 +00:00
parent 7f3a6e42c9
commit 787096051b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165105
6 changed files with 41 additions and 41 deletions

View File

@ -413,27 +413,27 @@ unsetbridge_autoedge(const char *val, int d, int s, const struct afswtch *afp)
}
static void
setbridge_p2p(const char *val, int d, int s, const struct afswtch *afp)
setbridge_ptp(const char *val, int d, int s, const struct afswtch *afp)
{
do_bridgeflag(s, val, IFBIF_BSTP_P2P, 1);
do_bridgeflag(s, val, IFBIF_BSTP_PTP, 1);
}
static void
unsetbridge_p2p(const char *val, int d, int s, const struct afswtch *afp)
unsetbridge_ptp(const char *val, int d, int s, const struct afswtch *afp)
{
do_bridgeflag(s, val, IFBIF_BSTP_P2P, 0);
do_bridgeflag(s, val, IFBIF_BSTP_PTP, 0);
}
static void
setbridge_autop2p(const char *val, int d, int s, const struct afswtch *afp)
setbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp)
{
do_bridgeflag(s, val, IFBIF_BSTP_AUTOP2P, 1);
do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 1);
}
static void
unsetbridge_autop2p(const char *val, int d, int s, const struct afswtch *afp)
unsetbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp)
{
do_bridgeflag(s, val, IFBIF_BSTP_AUTOP2P, 0);
do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 0);
}
static void
@ -681,10 +681,10 @@ static struct cmd bridge_cmds[] = {
DEF_CMD_ARG("-edge", unsetbridge_edge),
DEF_CMD_ARG("autoedge", setbridge_autoedge),
DEF_CMD_ARG("-autoedge", unsetbridge_autoedge),
DEF_CMD_ARG("p2p", setbridge_p2p),
DEF_CMD_ARG("-p2p", unsetbridge_p2p),
DEF_CMD_ARG("autop2p", setbridge_autop2p),
DEF_CMD_ARG("-autop2p", unsetbridge_autop2p),
DEF_CMD_ARG("ptp", setbridge_ptp),
DEF_CMD_ARG("-ptp", unsetbridge_ptp),
DEF_CMD_ARG("autoptp", setbridge_autoptp),
DEF_CMD_ARG("-autoptp", unsetbridge_autoptp),
DEF_CMD("flush", 0, setbridge_flush),
DEF_CMD("flushall", 0, setbridge_flushall),
DEF_CMD_ARG2("static", setbridge_static),

View File

@ -1296,24 +1296,24 @@ This is the default for all interfaces added to a bridge.
.It Cm -autoedge Ar interface
Disable automatic edge status on
.Ar interface .
.It Cm p2p Ar interface
.It Cm ptp Ar interface
Set the
.Ar interface
as a point to point link.
This is required for straight transitions to forwarding and
should be enabled on a direct link to another RSTP capable switch.
.It Cm -p2p Ar interface
.It Cm -ptp Ar interface
Disable point to point link status on
.Ar interface .
This should be disabled for a half duplex link and for an interface
connected to a shared network segment,
like a hub or a wireless network.
.It Cm autop2p Ar interface
.It Cm autoptp Ar interface
Automatically detect the point to point status on
.Ar interface
by checking the full duplex link status.
This is the default for interfaces added to the bridge.
.It Cm -autop2p Ar interface
.It Cm -autoptp Ar interface
Disable automatic point to point link detection on
.Ar interface .
.It Cm maxage Ar seconds

View File

@ -661,7 +661,7 @@ bstp_received_bpdu(struct bstp_state *bs, struct bstp_port *bp,
* only point to point links are allowed fast
* transitions to forwarding.
*/
if (cu->cu_agree && bp->bp_p2p_link) {
if (cu->cu_agree && bp->bp_ptp_link) {
bp->bp_agreed = 1;
bp->bp_proposing = 0;
} else
@ -1036,7 +1036,7 @@ bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp)
bp->bp_proposing = 1;
bp->bp_flags |= BSTP_PORT_NEWINFO;
bstp_timer_start(&bp->bp_edge_delay_timer,
(bp->bp_p2p_link ? BSTP_DEFAULT_MIGRATE_DELAY :
(bp->bp_ptp_link ? BSTP_DEFAULT_MIGRATE_DELAY :
bp->bp_desg_max_age));
DPRINTF("%s -> DESIGNATED_PROPOSE\n",
bp->bp_ifp->if_xname);
@ -1663,27 +1663,27 @@ bstp_set_autoedge(struct bstp_port *bp, int set)
}
int
bstp_set_p2p(struct bstp_port *bp, int set)
bstp_set_ptp(struct bstp_port *bp, int set)
{
struct bstp_state *bs = bp->bp_bs;
BSTP_LOCK(bs);
bp->bp_p2p_link = set;
bp->bp_ptp_link = set;
BSTP_UNLOCK(bs);
return (0);
}
int
bstp_set_autop2p(struct bstp_port *bp, int set)
bstp_set_autoptp(struct bstp_port *bp, int set)
{
struct bstp_state *bs = bp->bp_bs;
BSTP_LOCK(bs);
if (set) {
bp->bp_flags |= BSTP_PORT_AUTOP2P;
bp->bp_flags |= BSTP_PORT_AUTOPTP;
bstp_ifupdstatus(bs, bp);
} else
bp->bp_flags &= ~BSTP_PORT_AUTOP2P;
bp->bp_flags &= ~BSTP_PORT_AUTOPTP;
BSTP_UNLOCK(bs);
return (0);
}
@ -1804,8 +1804,8 @@ bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp)
if ((error == 0) && (ifp->if_flags & IFF_UP)) {
if (ifmr.ifm_status & IFM_ACTIVE) {
/* A full-duplex link is assumed to be point to point */
if (bp->bp_flags & BSTP_PORT_AUTOP2P) {
bp->bp_p2p_link =
if (bp->bp_flags & BSTP_PORT_AUTOPTP) {
bp->bp_ptp_link =
ifmr.ifm_active & IFM_FDX ? 1 : 0;
}
@ -2163,7 +2163,7 @@ bstp_create(struct bstp_state *bs, struct bstp_port *bp, struct ifnet *ifp)
/* Init state */
bp->bp_infois = BSTP_INFO_DISABLED;
bp->bp_flags = BSTP_PORT_AUTOEDGE|BSTP_PORT_AUTOP2P;
bp->bp_flags = BSTP_PORT_AUTOEDGE|BSTP_PORT_AUTOPTP;
bstp_set_port_state(bp, BSTP_IFSTATE_DISCARDING);
bstp_set_port_proto(bp, bs->bs_protover);
bstp_set_port_role(bp, BSTP_ROLE_DISABLED);

View File

@ -108,7 +108,7 @@
#define BSTP_PORT_DISPUTED 0x0004
#define BSTP_PORT_ADMCOST 0x0008
#define BSTP_PORT_AUTOEDGE 0x0010
#define BSTP_PORT_AUTOP2P 0x0020
#define BSTP_PORT_AUTOPTP 0x0020
#define BSTP_PORT_ADMEDGE 0x0040
/* BPDU priority */
@ -305,7 +305,7 @@ struct bstp_port {
uint8_t bp_tc_prop;
uint8_t bp_fdbflush;
uint8_t bp_priority;
uint8_t bp_p2p_link;
uint8_t bp_ptp_link;
uint8_t bp_agree;
uint8_t bp_agreed;
uint8_t bp_sync;
@ -384,8 +384,8 @@ int bstp_set_port_priority(struct bstp_port *, int);
int bstp_set_path_cost(struct bstp_port *, uint32_t);
int bstp_set_edge(struct bstp_port *, int);
int bstp_set_autoedge(struct bstp_port *, int);
int bstp_set_p2p(struct bstp_port *, int);
int bstp_set_autop2p(struct bstp_port *, int);
int bstp_set_ptp(struct bstp_port *, int);
int bstp_set_autoptp(struct bstp_port *, int);
struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *);
#endif /* _KERNEL */

View File

@ -1020,10 +1020,10 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg)
req->ifbr_ifsflags |= IFBIF_BSTP_EDGE;
if (bp->bp_flags & BSTP_PORT_AUTOEDGE)
req->ifbr_ifsflags |= IFBIF_BSTP_AUTOEDGE;
if (bp->bp_p2p_link)
req->ifbr_ifsflags |= IFBIF_BSTP_P2P;
if (bp->bp_flags & BSTP_PORT_AUTOP2P)
req->ifbr_ifsflags |= IFBIF_BSTP_AUTOP2P;
if (bp->bp_ptp_link)
req->ifbr_ifsflags |= IFBIF_BSTP_PTP;
if (bp->bp_flags & BSTP_PORT_AUTOPTP)
req->ifbr_ifsflags |= IFBIF_BSTP_AUTOPTP;
if (bp->bp_flags & BSTP_PORT_ADMEDGE)
req->ifbr_ifsflags |= IFBIF_BSTP_ADMEDGE;
if (bp->bp_flags & BSTP_PORT_ADMCOST)
@ -1062,8 +1062,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
/* Pass on STP flags */
bstp_set_edge(bp, req->ifbr_ifsflags & IFBIF_BSTP_EDGE ? 1 : 0);
bstp_set_autoedge(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOEDGE ? 1 : 0);
bstp_set_p2p(bp, req->ifbr_ifsflags & IFBIF_BSTP_P2P ? 1 : 0);
bstp_set_autop2p(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOP2P ? 1 : 0);
bstp_set_ptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_PTP ? 1 : 0);
bstp_set_autoptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOPTP ? 1 : 0);
/* Save the bits relating to the bridge */
bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK;

View File

@ -138,15 +138,15 @@ struct ifbreq {
#define IFBIF_STICKY 0x0010 /* if learned addresses stick */
#define IFBIF_BSTP_EDGE 0x0020 /* member stp edge port */
#define IFBIF_BSTP_AUTOEDGE 0x0040 /* member stp autoedge enabled */
#define IFBIF_BSTP_P2P 0x0080 /* member stp p2p */
#define IFBIF_BSTP_AUTOP2P 0x0100 /* member stp autop2p enabled */
#define IFBIF_BSTP_PTP 0x0080 /* member stp point to point */
#define IFBIF_BSTP_AUTOPTP 0x0100 /* member stp autoptp enabled */
#define IFBIF_BSTP_ADMEDGE 0x0200 /* member stp admin edge enabled */
#define IFBIF_BSTP_ADMCOST 0x0400 /* member stp admin path cost */
#define IFBIFBITS "\020\001LEARNING\002DISCOVER\003STP\004SPAN" \
"\005STICKY\006EDGE\007AUTOEDGE\010P2P\011AUTOP2P"
#define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_P2P| \
IFBIF_BSTP_AUTOP2P|IFBIF_BSTP_ADMEDGE| \
"\005STICKY\006EDGE\007AUTOEDGE\010PTP\011AUTOPTP"
#define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_PTP| \
IFBIF_BSTP_AUTOPTP|IFBIF_BSTP_ADMEDGE| \
IFBIF_BSTP_ADMCOST) /* not saved */
/* BRDGFLUSH */