The system provides a python object: alc.esm, to provide flexible LUDB lookup and return ESM attributes directly from script.
alc.esm support both DHCPv4/v6 and PPPoE hosts.
alc.esm has following attribute and function:
alc.esm.derivedId: A string used as LUDB lookup key
alc.esm.set(ESM-key, value): Set the value of specified ESM attribute, it is used for ESM host creation.
alc.esm.derivedId should be set for all types of ingress packets that system used to access LUDB; for example PPPoE PADI and PADR, DHCP discovery and request.
The following is a list of supported ESM-key and its corresponding Python type:
alc.esm.accountingPolicy:str
alc.esm.ancpString:str
alc.esm.appProfileString:str
alc.esm.catMapString:str
alc.esm.defGw:str
alc.esm.dhcpv4GIAddr:str
alc.esm.dhcpv4Pool:str
alc.esm.dhcpv4ServerAddr:str
alc.esm.dhcpv6LinkAddr:str
alc.esm.dhcpv6ServerAddr:str
alc.esm.intDestId:str
alc.esm.ipAddress:str
alc.esm.ipv4LeaseTime:int
alc.esm.ipv4PrimDns:str
alc.esm.ipv4SecDns:str
alc.esm.ipv6Address:str
alc.esm.dhcpv6PreferredLifetime
alc.esm. dhcpv6RebindTimer
alc.esm. dhcpv6RenewTimer
alc.esm. dhcpv6ValidLifetime
alc.esm.ipv6DelegatedPrefix:str
alc.esm.ipv6DelegatedPrefixLength:int
alc.esm.ipv6PrefixPool:str
alc.esm.ipv6PrimDns:str
alc.esm.ipv6SecDns:str
alc.esm.ipv6SlaacPrefix:str
alc.esm.ipv6WanPool:str
alc.esm.msapGroupInterface:str
alc.esm.msapPolicy:str
alc.esm.msapServiceId:str
alc.esm.primNbns:str
alc.esm.retailServiceId:str
alc.esm.secNbns:str
alc.esm.slaProfileString:str
alc.esm.spiSharingGroupId:int
alc.esm.subIdent:str
alc.esm.subProfileString:str
alc.esm.subnetMask:str
alc.dtc.dhcpv6PreferredLifetime
alc.dtc.dhcpv6RebindTimer
alc.dtc.dhcpv6RenewTimer
alc.dtc.dhcpv6ValidLifetime
The following are PPPoE-specific keys:
alc.esm.padoDelay: int
alc.esm.pppAuthProtocol: str, {‛pap’|’chap’|’pref-chap’|’pref-pap’}
alc.esm.pppMTU: int
With PPPoE, alc.esm.set() could only be called ingress discovery (PADI, PADR) and authentication (PAP Authenticate, CHAP Response) packets. If it is called multiple times, the first one wins except the derived-id, while the alc.esm.padoDelay only applies when the system receives PADI. alc.esm.pppAuthProtocol and alc.esm.pppMTU can only be set when a PADR is received.
alc.esm.set() is blocked during LCP/IPCP/IP6CP phase.
The system raises an exception if alc.esm.set() is called at wrong time. Setting the ESM keys that do not apply to the host type are ignored; for example, setting PPP(oE) keys for DHCP hosts is ignored.
The value returned by alc.esm.set() take highest precedence than other sources like CLI/LUDB.
For alc.esm.set(ESM-key, value)
PPPoE can only be called for ingress discovery (PADI, PADR) and authentication (PAP Authenticate, CHAP Response) packets. An exception is raised otherwise (for example, wrong time, including egress discovery PADO and PADS, and authentication PAP Ack/Nak and CHAP Success/Failure).
The PPPoE key alc.esm.padoDelay can only be set when PADI is received (otherwise, it is too late).
Setting ESM keys for a PPPoE host which do not apply is ignored (that is, no exception is raised).
PPP keys alc.esm.pppAuthProtocol and alc.esm.pppMTU can only be set when PADR is received. It has no effect when PADI is received.
Setting PPP(oE) keys for a DHCP host is ignored.