Error: Unresolved PTYPE "UINT" in PARAM "p_int"

72 views
Skip to first unread message

ps z

unread,
Jun 18, 2021, 4:56:13 AM6/18/21
to klish-dev
I am new to Klish. I tried to use this in the existing XML
        <COMMAND name="gather basic"
            help="Gather logs">
            <PARAM name="p_int"
                    help="optional uint param"
                    ptype="UINT"
                    optional="true"/>
            <ACTION>
                   ***
            </ACTION>
        </COMMAND>

It is working fine without the shaded part - PARM.
After adding the PARAM tag, I am seeing this error.
Error: Unresolved PTYPE "UINT" in PARAM "p_int"

Any comment on it?
Thanks,
Prithvee.
A

David Balme

unread,
Jun 18, 2021, 2:14:51 PM6/18/21
to klis...@googlegroups.com
Do you have a types.xml file in the same directory for klish to read in?

klish is basically saying that it does not understand the specified PARAM type UINT.

I think it's a standard type that comes with the types.xml file in the klish distrib..  It's been so long that I don't remember ..

Either way .. my suggestion is that you make sure that you have a "types.xml" file in the same directory where you store your klish xml files.

My types.xml file looks like this ..  I don't recall if I have ever made changes to the original ... but in the xml text below, you will notice the definition of UINT.. That is what you need in your particular case.


<?xml version="1.0" encoding="UTF-8"?>

<CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

 xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema

                     http://clish.sourceforge.net/XMLSchema/clish.xsd">

    <!--=======================================================-->

<PTYPE name="VLAN_ID"

pattern="(409[0-5]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{2}|[1-9][0-9]|[1-9])"

help="Number in the range 1-4095"/>

<!--=======================================================-->

<PTYPE name="IP_ADDR"

pattern="(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))"

help="A.B.C.D"/>

<!--=======================================================-->

<PTYPE name="UINT"

pattern="[0-9]+"

help="Unsigned integer"/>

<!--=======================================================-->

<PTYPE name="STRING"

pattern=".+"

help="String"/>

<!--=======================================================-->

<PTYPE name="SUBCOMMAND"

pattern="[^\]+"

help="String"/>

<!--=======================================================-->

<PTYPE name="BOOL"

method="select"

pattern="true(1) false(0)"

help="Boolean choice"/>

<!--=======================================================-->

<PTYPE name="IFACE_NUM"

pattern="[0-9]+"

help="Interface number"/>

<!--=======================================================-->

<PTYPE name="PROTO"

method="select"

pattern="ip(ip) ipencap(ipencap) icmp(icmp) igmp(igmp) tcp(tcp) udp(udp)"

help="Protocol choice"/>

<!--=======================================================-->

<PTYPE name="SERVICE"

pattern="((ftp)|(telnet)|(sntp)|(smtp)|(http)|([0-9]+))"

help="Port"/>

<!--=======================================================-->

<PTYPE name="IP_ADDR_MASK"

pattern="(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(/(1[0-9]|2[0-9]|3[0-2]|[0-9]))?"

help="A.B.C.D[/mask]"/>

<!--=======================================================-->

<PTYPE name="IP_ADDR_ANY"

pattern="(((((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(/(1[0-9]|2[0-9]|3[0-2]|[0-9]))?)|any)"

help="A.B.C.D[/mask] or any"/>

<!--=======================================================-->

<PTYPE name="PORT_MASK_ANY"

pattern="^(([0-9]+(/0x[0-9a-f]+)?)|(any))$"

help="Port[/mask]" />

<!--=======================================================-->

<PTYPE name="SEQ"

pattern="^[0-9]*[1-9][0-9]*"

help="Entry number"/>

<!--=======================================================-->

 

</CLISH_MODULE>




--
You received this message because you are subscribed to the Google Groups "klish-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish-dev/3d502435-09b9-4087-95e1-40436202025fn%40googlegroups.com.

ps z

unread,
Jul 12, 2021, 8:52:24 AM7/12/21
to klish-dev
Thanks  David.
It was essentially a types.xml file location issue.


Reply all
Reply to author
Forward
0 new messages