separate status for l2 interfaes when running ospfstatus
@@ -38,10 +38,11 @@ public class OspfStatusQuestionPlugin extends QuestionPlugin {
public static class OspfStatusAnswerElement extends AnswerElement {
public enum OspfStatus {
+ DISABLED_EXPORTED,
+ DISABLED_NOT_EXPORTED,
ENABLED_ACTIVE,
ENABLED_PASSIVE,
- DISABLED_EXPORTED,
- DISABLED_NOT_EXPORTED
+ SWITCHPORT
}
public static class OspfInfo implements Comparable<OspfInfo> {
@@ -141,7 +142,10 @@ public class OspfStatusQuestionPlugin extends QuestionPlugin {
String interfaceName = e2.getKey();
Interface iface = e2.getValue();
if (question.getInterfacesSpecifier().matches(iface)) {
- if (iface.getOspfEnabled()) {
+ if (iface.getSwitchport() != null && iface.getSwitchport().booleanValue()) {
+ // it's a layer2 interface
+ answerElement.add(hostname, interfaceName, OspfStatus.SWITCHPORT);
+ } else if (iface.getOspfEnabled()) {
// ospf is running either passively or actively
if (iface.getOspfPassive()) {
if (question.matchesStatus(OspfStatus.ENABLED_PASSIVE)) {
