1 / 7

General Purpose Functions

General Purpose Functions. Utility Functions Account Security Functions. 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 );

Download Presentation

General Purpose Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. General Purpose Functions Utility Functions Account Security Functions

  2. 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

  3. Utility Functions – System Tick • void NATotalTicks( unsigned long *hidest, unsigned long *lodest); • Returns total ticks from system start • *hidest, *lodest: pointers to target fields for high- and low-order portions of system clock. • unsigned long NADeltaTicks (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

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

  5. 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

  6. Account Security Functions – create/remove record • int NAsetSysAccess (unsigned int op, char *user, char *password, unsigned int level, char *ipAddr); • 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 • ipAddr: 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

  7. NAsetSysAccess 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

More Related