Keep in sync with the if_bridge(4) module (rev. 1.20 if_bridgevar.h,
1.12 bridgestp.h) and rename all PointToPoint related variables from P2P to PTP (s/P2P/PTP/g s/p2p/ptp/g). Approved by: bz (mentor)
This commit is contained in:
parent
42910bde6c
commit
3c6bf05583
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165416
@ -282,8 +282,8 @@ bridge_new_port(struct mibif *mif, struct bridge_if *bif)
|
||||
bp->proto_migr = TruthValue_false;
|
||||
bp->admin_edge = TruthValue_false;
|
||||
bp->oper_edge = TruthValue_false;
|
||||
bp->oper_p2p = TruthValue_false;
|
||||
bp->admin_p2p = StpPortAdminPointToPointType_auto;
|
||||
bp->oper_ptp = TruthValue_false;
|
||||
bp->admin_ptp = StpPortAdminPointToPointType_auto;
|
||||
|
||||
bridge_port_memif_insert(&bridge_ports, bp, &(bif->f_bp));
|
||||
|
||||
@ -630,8 +630,8 @@ op_dot1d_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
StpPortAdminPointToPointType_auto)
|
||||
return (SNMP_ERR_WRONG_VALUE);
|
||||
|
||||
ctx->scratch->int1 = bp->admin_p2p;
|
||||
if (bridge_port_set_admin_p2p(bif->bif_name, bp,
|
||||
ctx->scratch->int1 = bp->admin_ptp;
|
||||
if (bridge_port_set_admin_ptp(bif->bif_name, bp,
|
||||
val->v.integer) < 0)
|
||||
return (SNMP_ERR_GENERR);
|
||||
return (SNMP_ERR_NOERROR);
|
||||
@ -665,7 +665,7 @@ op_dot1d_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
ctx->scratch->int1);
|
||||
break;
|
||||
case LEAF_dot1dStpPortAdminPointToPoint:
|
||||
bridge_port_set_admin_p2p(bif->bif_name, bp,
|
||||
bridge_port_set_admin_ptp(bif->bif_name, bp,
|
||||
ctx->scratch->int1);
|
||||
break;
|
||||
case LEAF_dot1dStpPortAdminPathCost:
|
||||
@ -695,11 +695,11 @@ op_dot1d_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_dot1dStpPortAdminPointToPoint:
|
||||
val->v.integer = bp->admin_p2p;
|
||||
val->v.integer = bp->admin_ptp;
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_dot1dStpPortOperPointToPoint:
|
||||
val->v.integer = bp->oper_p2p;
|
||||
val->v.integer = bp->oper_ptp;
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_dot1dStpPortAdminPathCost:
|
||||
@ -1353,8 +1353,8 @@ op_begemot_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
StpPortAdminPointToPointType_auto)
|
||||
return (SNMP_ERR_WRONG_VALUE);
|
||||
|
||||
ctx->scratch->int1 = bp->admin_p2p;
|
||||
if (bridge_port_set_admin_p2p(b_name, bp,
|
||||
ctx->scratch->int1 = bp->admin_ptp;
|
||||
if (bridge_port_set_admin_ptp(b_name, bp,
|
||||
val->v.integer) < 0)
|
||||
return (SNMP_ERR_GENERR);
|
||||
return (SNMP_ERR_NOERROR);
|
||||
@ -1388,7 +1388,7 @@ op_begemot_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
ctx->scratch->int1);
|
||||
break;
|
||||
case LEAF_begemotBridgeStpPortAdminPointToPoint:
|
||||
bridge_port_set_admin_p2p(b_name, bp,
|
||||
bridge_port_set_admin_ptp(b_name, bp,
|
||||
ctx->scratch->int1);
|
||||
break;
|
||||
case LEAF_begemotBridgeStpPortAdminPathCost:
|
||||
@ -1418,11 +1418,11 @@ op_begemot_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val,
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_begemotBridgeStpPortAdminPointToPoint:
|
||||
val->v.integer = bp->admin_p2p;
|
||||
val->v.integer = bp->admin_ptp;
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_begemotBridgeStpPortOperPointToPoint:
|
||||
val->v.integer = bp->oper_p2p;
|
||||
val->v.integer = bp->oper_ptp;
|
||||
return (SNMP_ERR_NOERROR);
|
||||
|
||||
case LEAF_begemotBridgeStpPortAdminPathCost:
|
||||
|
@ -124,8 +124,8 @@ struct bridge_port {
|
||||
enum TruthValue proto_migr;
|
||||
enum TruthValue admin_edge;
|
||||
enum TruthValue oper_edge;
|
||||
enum TruthValue oper_p2p;
|
||||
enum StpPortAdminPointToPointType admin_p2p;
|
||||
enum TruthValue oper_ptp;
|
||||
enum StpPortAdminPointToPointType admin_ptp;
|
||||
|
||||
/* dot1dTp subtree objects. */
|
||||
int32_t max_info;
|
||||
@ -330,8 +330,8 @@ int bridge_port_set_path_cost(const char *bif_name, struct bridge_port *bp,
|
||||
int32_t path_cost);
|
||||
|
||||
/* Set admin point-to-point link. */
|
||||
int bridge_port_set_admin_p2p(const char *bif_name, struct bridge_port *bp,
|
||||
uint32_t admin_p2p);
|
||||
int bridge_port_set_admin_ptp(const char *bif_name, struct bridge_port *bp,
|
||||
uint32_t admin_ptp);
|
||||
|
||||
/* Set admin edge. */
|
||||
int bridge_port_set_admin_edge(const char *bif_name, struct bridge_port *bp,
|
||||
|
@ -693,18 +693,18 @@ bridge_port_getinfo_conf(struct ifbreq *k_info, struct bridge_port *bp)
|
||||
else
|
||||
bp->oper_edge = TruthValue_false;
|
||||
|
||||
if (k_info->ifbr_ifsflags & IFBIF_BSTP_AUTOP2P) {
|
||||
bp->admin_p2p = StpPortAdminPointToPointType_auto;
|
||||
if (k_info->ifbr_ifsflags & IFBIF_BSTP_P2P)
|
||||
bp->oper_p2p = TruthValue_true;
|
||||
if (k_info->ifbr_ifsflags & IFBIF_BSTP_AUTOPTP) {
|
||||
bp->admin_ptp = StpPortAdminPointToPointType_auto;
|
||||
if (k_info->ifbr_ifsflags & IFBIF_BSTP_PTP)
|
||||
bp->oper_ptp = TruthValue_true;
|
||||
else
|
||||
bp->oper_p2p = TruthValue_false;
|
||||
} else if (k_info->ifbr_ifsflags & IFBIF_BSTP_P2P) {
|
||||
bp->admin_p2p = StpPortAdminPointToPointType_forceTrue;
|
||||
bp->oper_p2p = TruthValue_true;
|
||||
bp->oper_ptp = TruthValue_false;
|
||||
} else if (k_info->ifbr_ifsflags & IFBIF_BSTP_PTP) {
|
||||
bp->admin_ptp = StpPortAdminPointToPointType_forceTrue;
|
||||
bp->oper_ptp = TruthValue_true;
|
||||
} else {
|
||||
bp->admin_p2p = StpPortAdminPointToPointType_forceFalse;
|
||||
bp->oper_p2p = TruthValue_false;
|
||||
bp->admin_ptp = StpPortAdminPointToPointType_forceFalse;
|
||||
bp->oper_ptp = TruthValue_false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -855,14 +855,14 @@ bridge_port_set_path_cost(const char *bif_name, struct bridge_port *bp,
|
||||
* Set the PonitToPoint status of the link administratively.
|
||||
*/
|
||||
int
|
||||
bridge_port_set_admin_p2p(const char *bif_name __unused,
|
||||
struct bridge_port *bp __unused, uint32_t admin_p2p __unused)
|
||||
bridge_port_set_admin_ptp(const char *bif_name __unused,
|
||||
struct bridge_port *bp __unused, uint32_t admin_ptp __unused)
|
||||
{
|
||||
#if __FreeBSD_version > 700024
|
||||
struct ifdrv ifd;
|
||||
struct ifbreq b_req;
|
||||
|
||||
if (bp->admin_p2p == admin_p2p)
|
||||
if (bp->admin_ptp == admin_ptp)
|
||||
return (0);
|
||||
|
||||
bzero(&b_req, sizeof(b_req));
|
||||
@ -878,17 +878,17 @@ bridge_port_set_admin_p2p(const char *bif_name __unused,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
switch (admin_p2p) {
|
||||
switch (admin_ptp) {
|
||||
case StpPortAdminPointToPointType_forceTrue:
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_AUTOP2P;
|
||||
b_req.ifbr_ifsflags |= IFBIF_BSTP_P2P;
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_AUTOPTP;
|
||||
b_req.ifbr_ifsflags |= IFBIF_BSTP_PTP;
|
||||
break;
|
||||
case StpPortAdminPointToPointType_forceFalse:
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_AUTOP2P;
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_P2P;
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_AUTOPTP;
|
||||
b_req.ifbr_ifsflags &= ~IFBIF_BSTP_PTP;
|
||||
break;
|
||||
case StpPortAdminPointToPointType_auto:
|
||||
b_req.ifbr_ifsflags |= IFBIF_BSTP_AUTOP2P;
|
||||
b_req.ifbr_ifsflags |= IFBIF_BSTP_AUTOPTP;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -899,7 +899,7 @@ bridge_port_set_admin_p2p(const char *bif_name __unused,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bp->admin_p2p = admin_p2p;
|
||||
bp->admin_ptp = admin_ptp;
|
||||
return (0);
|
||||
#else
|
||||
return (-1);
|
||||
|
Loading…
Reference in New Issue
Block a user