-
Notifications
You must be signed in to change notification settings - Fork 1
/
login_control.tbh
40 lines (36 loc) · 1.37 KB
/
login_control.tbh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'===========================================================================
' login_control library
'
' required device specific properties and methods:
' sub device_login_event(op as cmd_modes)
' function device_get_timeout(cm as cmd_modes) as word
'===========================================================================
enum cmd_modes 'in the order of least to highest priority
CMD_MODE_NONE,
CMD_MODE_AGGREGATE,
CMD_MODE_INBAND,
CMD_MODE_HTTP,
CMD_MODE_TELNET,
CMD_MODE_UDP,
CMD_MODE_SERIAL,
CMD_MODE_TERMINAL
end enum
enum login_comparison_codes
LC_WILL_ACCEPT,
LC_WILL_ACCEPT_REPEATED_LOGIN,
LC_WILL_ACCEPT_LOWER_IN_PROGRESS,
LC_WILL_REJECT_HIGHER_IN_PROGRESS,
LC_WILL_REJECT_SAME_IN_PROGRESS
end enum
'------------------------------------------------------------------------------
declare login_mode as cmd_modes
declare login_data as string(32)
declare login_sock as byte
'------------------------------------------------------------------------------
declare function login(new_login as cmd_modes, cmd_data as string(32), socket as byte) as ok_ng
declare function compare_logins(new_login as cmd_modes, cmd_data as string(32), socket as byte) as login_comparison_codes
declare sub logout()
declare sub login_timer_proc()
declare sub login_timeout_reset()
declare sub device_login_event(mode as cmd_modes)
declare function device_get_timeout(mode as cmd_modes) as word