导读 net-snmp API分为两种,一种叫传统API(Traditional API),一种叫单个API(Single API)。早期的neet-snmp没有考虑到多线程的问题,所有的会话共享同一个资源,这些就是传统API,后来支持多线程的就叫做单个API。,这里贴出一部分关键内容。 The functions in the following table are functionally equivalent, with the exception of these behaviors: - The Traditional API manages many sessions - The Traditional API passes a struct snmp_session pointer, and touches the Sessions list - The Single API manages only one session - The Single API passes an opaque pointer, and does not use Sessions list
Traditional Single Comment =========== ============== ======= snmp_sess_init snmp_sess_init Call before either open snmp_open snmp_sess_open Single not on Sessions list snmp_sess_session Exposes snmp_session pointer snmp_send snmp_sess_send Send one APDU snmp_async_send snmp_sess_async_send Send one APDU with callback snmp_select_info snmp_sess_select_info Which session(s) have input snmp_read snmp_sess_read Read APDUs snmp_timeout snmp_sess_timeout Check for timeout snmp_close snmp_sess_close Single not on Sessions list snmp_synch_response snmp_sess_synch_response Send/receive one APDU snmp_error snmp