Clish programming,

1,499 views
Skip to first unread message

vishal girisagar

unread,
Mar 10, 2011, 6:02:59 AM3/10/11
to klish


Hello every one,
I am using Clish to implement CISCO standard commands. I have
installed it.

I was able to write small commands using .xml file.

I am not understanding how to pass the paramaters to .c file from
CLISH shell, and how to link .xml and .c file.....

I need help in this regard. please help me regarding this.....

Thank you,

Clark J. Wang

unread,
Mar 10, 2011, 6:07:03 AM3/10/11
to kl...@googlegroups.com, vishal girisagar
On Thu, Mar 10, 2011 at 7:02 PM, vishal girisagar <vishalgir...@gmail.com> wrote:


Hello every one,
I am using Clish to implement CISCO standard commands. I have
installed it.

I was able to write small commands using .xml file.

I am not understanding how to pass the paramaters to .c file from
CLISH shell, and how to link .xml and .c file.....


First you have to compile your .c files to a standalone executable command and then invoke that command from .xml files.
 
I need help in this regard. please help me regarding this.....

Thank you,

--
Clark J. Wang

vishal girisagar

unread,
Mar 11, 2011, 1:27:39 AM3/11/11
to kl...@googlegroups.com
I was able to pass paramaters to executable file of .c ..
But i want the value back from executable file.
i mean for addition of 2 no say 23 and 43,
I pass 23 and 43 as parameters.
but how can i get back the answer into .xml files?


--
VISHAL .V. GIRISAGAR
Department of Electronics and Communication engineering
BVBCET
Hubli - 580031

Serj Kalichev

unread,
Mar 11, 2011, 5:02:01 AM3/11/11
to kl...@googlegroups.com, vishal girisagar
Hi

I can't realize your aim and scheme.
Do you want to use builtin functions?
Or execute external binaries?
Where are you going to use answer? In <ACTION>?

2011/3/11 vishal girisagar <vish...@gmail.com>:

Serj Kalichev

unread,
Mar 14, 2011, 4:29:47 AM3/14/11
to vishal girisagar, klish
The original clish has access field in COMMAND tag. The comment from
clish.xsd scheme file:
"[access] - defines the user group/level to which execution of this.
command is restricted. By default there is no restriction.
The exact interpretation of this field is dependant on the
client of libclish but for example the clish and tclish.
applications map this to the UNIX user groups.
"

But I prefer to fork another klish from klish and change the real
user. It's more secure. See the "enable" COMMAND from xml-examples in
klish source tree. Additionally see
http://code.google.com/p/klish/wiki/klish_examples

Please "answer to all" to send emails to mailing list but not only to me.

2011/3/12 vishal girisagar <vish...@gmail.com>:
> thank you,
>   and one more thing. How can i provide different privilages to
> different users???
>
> On 3/11/11, Serj Kalichev <serj.k...@gmail.com> wrote:
>> Do you mean a common shell programming?
>> By default the script within <ACTION> tag is shell script. See the
>> xml-examples in klish source tree.
>>
>> 2011/3/11 vishal girisagar <vish...@gmail.com>:
>>> I am going to use in action.......
>>> i want to have my own seperate files and i want to pass parameters to
>>> that file and execute it when certain command is typed in clish...

vishal girisagar

unread,
Mar 20, 2011, 5:29:13 AM3/20/11
to kl...@googlegroups.com
thanks a lot for answering my earlier question.

Now one more thing.....
I want to configure some settings through klish. say i want to configure network settings using some commands.
when i restart i want to reload those settings. so i want to store those. Is there any way to store the values in klish..??

In short i want to store some values and want to restore them back at every start up. and while restoring the latest modified value should be restored...
 
Please help me regarding this.....




--

Serj Kalichev

unread,
Mar 21, 2011, 5:11:35 AM3/21/11
to kl...@googlegroups.com, vishal girisagar
See the wiki pages on http://code.google.com/p/klish/w/list for some
klish specific information.
See the http://clish.sourceforge.net/ for original clish
documentation. The klish is based on clish.

There is konfd daemon in klish sourcecode that can store user
configuration (user commands, settings). The clish utility can get
filenames as args in command line to execute commands from it.
example:
clish /etc/startup-config
The command must have CONFIG tag to get into the config (konfd daemon).

2011/3/20 vishal girisagar <vishalgir...@gmail.com>:

Mallikarjun Bale

unread,
Nov 13, 2017, 7:29:50 AM11/13/17
to klish
Hi friends,
 
I am new to CLISH, presently we are using the clish tool in my project,

i want help for how to call the c function from the clish command or is there any way to integrate the clish with c function

i.e. if in cli tool by command we can get gain parameter from user, now after getting this parameter we can pass as argument to c function for setting the gain of the transmitter.


Thank you,

Serj Kalichev

unread,
Nov 13, 2017, 8:59:18 AM11/13/17
to kl...@googlegroups.com
Hi

See plugin examples in source-code tree

13.11.2017 15:29, Mallikarjun Bale пишет:
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Mallikarjun Bale

unread,
Nov 14, 2017, 2:21:02 AM11/14/17
to klish
Hi Serj,

Thank you a lot for the guidance, i gone through the file 
klish/plugins/clish/builtin_init.c , i am not getting how exactly i can compile my c function and plugin it.
it will be very helpful if i get one sample example,

Thank you a lot and waiting for your reply.
Reply all
Reply to author
Forward
0 new messages