Hi,
How do you envision implementing other Line Cards for a given vendor? Do you expand the Vendor Port function matching on HardwareModel?
Let's say I want to add support for other Juniper interfaces:
et—Ethernet interfaces (10-, 25-, 40-, 50-, 100-, 200-, and 400-Gigabit Ethernet interface).
ge—Gigabit Ethernet interface
xe—10-Gigabit Ethernet interface. Some older 10-Gigabit Ethernet interfaces use the ge media type (rather than xe) to identify the physical part of the network device (XENPAK 10-Gigabit Ethernet interface PIC, which is supported only on M series routers).
Then, I'd have to check HardwareModel before nameBuilder.WriteString("et-") and also change nameBuilder.WriteString("/0") to nameBuilder.WriteString(fmt.Sprintf("%d", pp.PICIndex)). Does that sound correct to you?
unc (n *Namer) Port(pp *namer.PortParams) (string, error) {
if !pp.Channelizable {
return "", fmt.Errorf("Juniper does not support unchannelizable ports")
}
var nameBuilder strings.Builder
nameBuilder.WriteString("et-")
if pp.SlotIndex == nil {
nameBuilder.WriteString("0/")
nameBuilder.WriteString(fmt.Sprintf("%d", pp.PICIndex))
} else {
nameBuilder.WriteString(fmt.Sprintf("%d", *pp.SlotIndex))
nameBuilder.WriteString("/0")
}
nameBuilder.WriteString(fmt.Sprintf("/%d", pp.PortIndex))
if pp.ChannelIndex != nil {
nameBuilder.WriteString(fmt.Sprintf(":%d", *pp.ChannelIndex))
}
return nameBuilder.String(), nil
}

Hi,
How do you envision implementing other Line Cards for a given vendor? Do you expand the Vendor
Portfunction matching onHardwareModel?Let's say I want to add support for other Juniper interfaces:
et—Ethernet interfaces (10-, 25-, 40-, 50-, 100-, 200-, and 400-Gigabit Ethernet interface).ge—Gigabit Ethernet interfacexe—10-Gigabit Ethernet interface. Some older 10-Gigabit Ethernet interfaces use the ge media type (rather than xe) to identify the physical part of the network device (XENPAK 10-Gigabit Ethernet interface PIC, which is supported only on M series routers).Then, I'd have to check
HardwareModelbeforenameBuilder.WriteString("et-")and also changenameBuilder.WriteString("/0")tonameBuilder.WriteString(fmt.Sprintf("%d", pp.PICIndex)). Does that sound correct to you?