1
0
Fork 0

OsmoVTY: Add a initWith method to start the VTY...

The VTY code will be leaked..
This commit is contained in:
Holger Hans Peter Freyther 2010-09-11 16:15:40 +08:00
parent 6971bcc78d
commit e0e3681457
1 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,7 @@
"Copyright placeholder"
CStruct subclass: vty_app_info [
<category: 'libosmovty'>
<comment: 'I represent the vty_app_info... some structs are wrong'>
<declaration: #(
(#name #string)
@ -30,20 +31,20 @@ Object subclass: OSMOVTY [
OSMOVTY class >> telnet_init: tall_context priv: priv port: aPort [
<cCall: 'telnet_init' returning: #int args: #(#cObject #cObject #int) >
]
OSMOVTY class >> initWith: aName version: aVersion license: aLicense port: aPort [
| app_info |
app_info := vty_app_info new.
app_info name value: aName.
app_info version value: aVersion.
app_info copyright value: aLicense.
OSMOVTY vty_init: app_info.
OSMOVTY telnet_init: nil priv: nil port: 4444.
]
]
Eval [
| app_info |
OSMOVTY initialize.
app_info := vty_app_info gcNew.
app_info name value: 'Smalltalk VTY', Character cr, Character lf.
app_info version value: '1.0.0', Character cr, Character lf.
app_info copyright value: 'GPL bla', Character cr, Character lf.
app_info inspect.
OSMOVTY vty_init: app_info.
OSMOVTY vty_read_config_file: 'foo.cfg' priv: app_info.
OSMOVTY telnet_init: nil priv: nil port: 4444.
]