1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-binding/OsmoVTY.st

51 lines
1.4 KiB
Smalltalk
Raw Normal View History

2010-09-11 06:12:00 +00:00
"Copyright placeholder"
CStruct subclass: vty_app_info [
<category: 'libosmovty'>
2010-09-11 06:12:00 +00:00
<comment: 'I represent the vty_app_info... some structs are wrong'>
<declaration: #(
(#name #string)
(#version #string)
(#copyright #string)
(#tall_ctx (#ptr #int))
(#go_parent_cb (#ptr #int))
(#is_config_node (#ptr #int))) >
]
Object subclass: OSMOVTY [
<comment: 'I provide access to the VTY code'>
<category: 'libosmovty'>
OSMOVTY class >> initialize [
DLD addLibrary: 'libosmovty.so.0'
]
OSMOVTY class >> vty_init: app_info [
<cCall: 'vty_init' returning: #void args: #(#cObject) >
]
OSMOVTY class >> vty_read_config_file: file_name priv: priv [
<cCall: 'vty_read_config_file' returning: #int args: #(#string (#ptr #long)) >
]
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 |
2010-09-11 06:12:00 +00:00
app_info := vty_app_info new.
app_info name value: aName.
app_info version value: aVersion.
app_info copyright value: aLicense.
2010-09-11 06:12:00 +00:00
OSMOVTY vty_init: app_info.
OSMOVTY telnet_init: nil priv: nil port: 4444.
]
]
2010-09-11 06:12:00 +00:00
Eval [
OSMOVTY initialize.
2010-09-11 06:12:00 +00:00
]