userDefinedLang IP address parsing
-
I have a user defined language for Cisco IOS and using the UserDefinedLang dialog, I have a “Number Style” defined. This seems to match IPv4 addresses as well as just plain decimal numbers. However, for IPv6 addresses, the addresses contain hex letters (a-f) so they aren’t recognized as numbers.
The UDL spec seems to indicate you can use a prefix (0x) and the use extras (A B C D E F a b c d e f) and that “does” work, but IPv6 address don’t have the 0x prefix.
Is there someway to get an UDL to recognize IPv6 addresses?
interface Loopback0 ip address 10.254.254.1 255.255.255.255 ipv6 address 2001:DB8:AFE:FE00::1/128
I’d like those “middle bits” (DB8:AFE:FE00) to match the formatting of the numbers surrounding them.
-
did you try a delimiter using : as start and :: as end?
-
maybe using ((EOL)) as end is better !?
-
@Ekopalypse said:
did you try a delimiter using : as start and :: as end?
NO! And that was a great help…
I now have
Delimiter 1
Open = :
Close = ((EOL :: /))which helps catch the case of a full address (e.g., 2001:DB8:AAAA:BBBB:CCCC:DDDD:EEEE:FFFF/64) i.e., there is no “::”.
I think this is workable for now!
Cheers.
-
hmm, not quite sure if it is expected to have one opening but three closing identifiers. A first test didn’t reveal any issues but who knows …
And if I think about it, I assume EOL will always be true and therefore the other two won’t get into consideration at all. -
Good morning, can you help me to register ULD with IPV4
-
Hy, the problem is ok in IPV4, add config:
Prefix 2 : 0 1 2 3 4 5 6 7 8 9
Extras 1: .
Range: -
Decimal separator: Dot