General Purpose Functions Utility Functions Account Security Functions

  • Slides: 7
Download presentation
General Purpose Functions Utility Functions Account Security Functions

General Purpose Functions Utility Functions Account Security Functions

Utility Functions – IP Address Conversion • unsigned long NAInet_addr( char *addrp ); –

Utility Functions – IP Address Conversion • unsigned long NAInet_addr( char *addrp ); – “dot” notation C string to unsigned long • void NAInet_toa( unsigned long ipaddr, char *dest ); – Unsigned long to “dot” notation C string – Destination must be >= 16 characters

Utility Functions – System Tick • void NATotal. Ticks( unsigned long *hidest, unsigned long

Utility Functions – System Tick • void NATotal. Ticks( unsigned long *hidest, unsigned long *lodest); – Returns total ticks from system start – *hidest, *lodest: pointers to target fields for highand low-order portions of system clock. • unsigned long NADelta. Ticks (unsigned long hiord, unsigned long loord); – Returns difference in ticks from supplied value to “now” – hiord, loord: high- and low-order portions of supplied value

Account Security Functions get • unsigned int NAget. Sys. Access (char *user, char *password,

Account Security Functions get • unsigned int NAget. Sys. Access (char *user, char *password, unsigned int *ip. Addr); – For account name user, returns the account password in password – ip. Addr points to an optional IP address filter – Returns account privilege, a combination of one or more from the following slide

Access Level Bit Settings • NASYSACC_LEVEL_R (read only) • NASYSACC_LEVEL_RW (read/write) • NASYSACC_LEVEL_HTTP_Rx (can

Access Level Bit Settings • NASYSACC_LEVEL_R (read only) • NASYSACC_LEVEL_RW (read/write) • NASYSACC_LEVEL_HTTP_Rx (can access Web pages in the indicated security realm) • NASYSACC_LEVEL_GATEWAY (can be used for secure gateway) • NASYSACC_LEVEL_SNMP_R (defines SNMP public community string) • NASYSACC_LEVEL_SNMP_RW (defines SNMP private community string) • NASYSACC_LEVEL_ROOT (full privileges) • 0 – no privileges or NULL password

Account Security Functions – create/remove record • int NAset. Sys. Access (unsigned int op,

Account Security Functions – create/remove record • int NAset. Sys. Access (unsigned int op, char *user, char *password, unsigned int level, char *ip. Addr); – op: NASYSACC_ADD or NASYSACC_DEL – user: pointer to account name, default <= 80 bytes – password: pointer to password, default <= 80 bytes – level: same as previous slide – ip. Addr: pointer to IP address as a C string in “dot” notation; allow account access from this IP address only. May be NULL. – Return: see next slide

NAset. Sys. Access Return Codes • • • 0 (Success) NASYSACC_INVALID_OPERATION NASYSACC_INVALID_USERNAME NASYSACC_DUPLICATE_USERNAME NASYSACC_INVALID_PASSWORD

NAset. Sys. Access Return Codes • • • 0 (Success) NASYSACC_INVALID_OPERATION NASYSACC_INVALID_USERNAME NASYSACC_DUPLICATE_USERNAME NASYSACC_INVALID_PASSWORD NASYSACC_INVALID_IPADDRESS NASYSACC_INVALID_ACCOUNT NASYSACC_DATABASE_FULL NASYSACC_NOMEM