OsmoVTY: Add a initWith method to start the VTY...
The VTY code will be leaked..
This commit is contained in:
parent
6971bcc78d
commit
e0e3681457
25
OsmoVTY.st
25
OsmoVTY.st
|
@ -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.
|
||||
]
|
||||
|
|
Reference in New Issue