|
|
The version of libsnmp supported on UnixWare 7 is the same as that supported on SCO UnixWare 2.1.X, and implements SNMP Version 1 (SNMPv1).
The SCO OpenServer version of libsnmp (included in /OpenServer/lib) is supported on UnixWare 7 for SCO OpenServer binaries only. By default, the SCO OpenServer library implements SNMP Version 2 (SNMPv2), unless the application is compiled with either SNMPV1 or SNMPV1_ONLY set.
The routines found in libsnmp are documented on the following manual pages:
The header files for SNMP are found in /usr/include/snmp on SCO OpenServer, and in /usr/include/netmgt on UnixWare.
Source compatibility for every one of these calls is affected by differences in the data structures used by the SCO OpenServer and UnixWare implementations. See the following sections for details:
Name of Interface | Legacy compatibility | UDK compatibility | |||||
---|---|---|---|---|---|---|---|
Compiled using SCO OpenServer DevSys | Compiled using SCO UnixWare 2.1.X SDK | Compiled using UnixWare 7 UDK | |||||
Library Name | Works on UnixWare 7? | Library Name | Works on UnixWare 7? | Library Name | Works on SCO OpenServer? | Works on SCO UnixWare 2.1.X? | |
build_authentication | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
build_pdu | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
build_v1_mesg
_from_pdu | libsnmp | Yes | -- | -- | -- | -- | -- |
decode_SMUX_PDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
encode_SMUX_PDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_ClosePDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_GetPDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_RReqPDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_RRspPDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_SimpleOpen | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_SOutPDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SMUX_TrapPDU | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_SNMP_SMUX_pdu | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_authentication | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_octetstring | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_oid | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_pdu | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
free_varbind_list | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
get_pdu_from_v1_mesg | libsnmp | Yes | -- | -- | libsnmp | -- | -- |
getsmuxEntrybyidentity | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
getsmuxEntrybyname | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
link_varbind | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
link_varbind_list | libsnmp | Yes | -- | -- | -- | -- | -- |
make_authentication | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_dot_from_obj_id | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_obj_id_from_dot | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_obj_id_from_hex | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_octet_from_hex | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_octet_from_text | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_octetstring | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_oid | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_pdu | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
make_varbind | libsnmp | Yes; notes. | libsnmp | Yes | libsnmp | Yes | Yes |
oid_cmp | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
oid_cpy | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
oid_extend | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
oid_normalize | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
os_cpy | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
parse_authentication | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
parse_pdu | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes; notes. | Yes |
print_ascii | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
print_octet_string_out | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
print_packet_out | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
print_varbind_list | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
sprintoid | libsnmp | Yes | libsnmp | Yes | libsnmp | Yes | Yes |
``Compatibility Table Legend''
The implementation of make_varbind on SCO OpenServer is as follows:
VarBindList make_varbind(OID oid_ptr, short type, unsigned long ul_value, long sl_value, OctetString os_value, OID oid_value, Counter64 *c64_value);
The Counter64
data type as well as the *c64_value
parameter to this function are not supported on UnixWare 7 and SCO UnixWare 2.1.X.
There are differences in VarBindList types and error returns between UnixWare and SCO OpenServer that impact source compatibility. The SCO OpenServer definitions in snmp.h are:
/* Universal's */ #define INTEGER_TYPE 0x02 #define BITSTRING_TYPE 0x03 #define OCTET_PRIM_TYPE 0x04 #define DisplayString OCTET_PRIM_TYPE #define NULL_TYPE 0x05 #define OBJECT_ID_TYPE 0x06 #define OCTET_CONSTRUCT_TYPE 0x24 #define SEQUENCE_TYPE 0x30 #define Aggregate 0xFF/* Primitive context's */ #define NO_SUCH_OBJECT 0x80 #define NO_SUCH_INSTANCE 0x81 #define END_OF_MIB_VIEW 0x82
/* Application's */ #define IP_ADDR_PRIM_TYPE 0x40 #define COUNTER_TYPE 0x41 #define GAUGE_TYPE 0x42 #define TIME_TICKS_TYPE 0x43 #define OPAQUE_PRIM_TYPE 0x44 #define IP_ADDR_CONSTRUCT_TYPE 0x60 #define OPAQUE_CONSTRUCT_TYPE 0x64
#define NSAP_ADDR_TYPE 0x45 #define COUNTER64_TYPE 0x46 #define UINTEGER_TYPE 0x47
/* Constructed context's */ #define GET_REQUEST_TYPE 0xA0 #define GET_NEXT_REQUEST_TYPE 0xA1 #define GET_RESPONSE_TYPE 0xA2 #define SET_REQUEST_TYPE 0xA3 #define TRAP_TYPE 0xA4 /* obsolete */ #define GET_BULK_REQUEST_TYPE 0xA5 #define INFORM_REQUEST_TYPE 0xA6 #define V2_TRAP_TYPE 0xA7
/* SNMPv2 message related types */ #define PRIV_MSG_TYPE 0xA1 #define PRIV_DATA_TYPE 0x81 #define AUTH_MSG_TYPE 0xA1 #define MD5_AUTH_INFO_TYPE 0xA2 #define NO_AUTH_INFO_TYPE 0x04 #define MGMT_COM_TYPE 0xA2
/* Application's SMUX */ #define SMUX__PDUs_simple 0x60 #define SMUX__PDUs_close 0x41 #define SMUX__PDUs_registerRequest 0x62 #define SMUX__PDUs_registerResponse 0x43 #define SMUX__PDUs_get__request 0xA0 #define SMUX__PDUs_get__next__request 0xA1 #define SMUX__PDUs_get__response 0xA2 #define SMUX__PDUs_set__request 0xA3 #define SMUX__PDUs_trap 0xA4 #define SMUX__PDUs_commitOrRollback 0x44
/* Error codes */ #define NO_ERROR 0 #define TOO_BIG_ERROR 1 #define NO_SUCH_NAME_ERROR 2 #define BAD_VALUE_ERROR 3 #define READ_ONLY_ERROR 4 #define GEN_ERROR 5 #define NO_ACCESS 6 #define WRONG_TYPE 7 #define WRONG_LENGTH 8 #define WRONG_ENCODING 9 #define WRONG_VALUE 10 #define NO_CREATION 11 #define INCONSISTENT_VALUE 12 #define RESOURCE_UNAVAILABLE 13 #define COMMIT_FAILED 14 #define UNDO_FAILED 15 #define AUTHORIZATION_ERROR 16 #define NOT_WRITEABLE 17 #define INCONSISTENT_NAME 18
The UnixWare definitions (from /usr/include/netmgt/snmp.h) are:
/* Universal's */ #define INTEGER_TYPE 0x02 #define OCTET_PRIM_TYPE 0x04 #define DisplayString OCTET_PRIM_TYPE #define NULL_TYPE 0x05 #define OBJECT_ID_TYPE 0x06 #define OCTET_CONSTRUCT_TYPE 0x24 #define SEQUENCE_TYPE 0x30 #define Aggregate 0xFF/* Application's */ #define IP_ADDR_PRIM_TYPE 0x40 #define COUNTER_TYPE 0x41 #define GAUGE_TYPE 0x42 #define TIME_TICKS_TYPE 0x43 #define OPAQUE_PRIM_TYPE 0x44 #define IP_ADDR_CONSTRUCT_TYPE 0x60 #define OPAQUE_CONSTRUCT_TYPE 0x64
/* Context's */ #define GET_REQUEST_TYPE 0xA0 #define GET_NEXT_REQUEST_TYPE 0xA1 #define GET_RESPONSE_TYPE 0xA2 #define SET_REQUEST_TYPE 0xA3 #define TRAP_TYPE 0xA4
/* Application's SMUX */ #define SMUX__PDUs_simple 0x60 #define SMUX__PDUs_close 0x41 #define SMUX__PDUs_registerRequest 0x62 #define SMUX__PDUs_registerResponse 0x43 #define SMUX__PDUs_get__request 0xA0 #define SMUX__PDUs_get__next__request 0xA1 #define SMUX__PDUs_get__response 0xA2 #define SMUX__PDUs_set__request 0xA3 #define SMUX__PDUs_trap 0xA4 #define SMUX__PDUs_commitOrRollback 0x44
#define SMUX_SIMPLE_TYPE 0x60 #define SMUX_CLOSE_TYPE 0x41 #define SMUX_REG_REQUEST_TYPE 0x62 #define SMUX_REG_RESPONSE_TYPE 0x43 #define SMUX_SOUT_TYPE 0x44
#define SMUX_GET_REQUEST_TYPE GET_REQUEST_TYPE #define SMUX_GET_NEXT_REQUEST_TYPE GET_NEXT_REQUEST_TYPE #define SMUX_GET_RESPONSE_TYPE GET_RESPONSE_TYPE #define SMUX_SET_REQUEST_TYPE SET_REQUEST_TYPE #define SMUX_TRAP_TYPE TRAP_TYPE
/* Error codes */ #define NO_ERROR 0 #define TOO_BIG_ERROR 1 #define NO_SUCH_NAME_ERROR 2 #define BAD_VALUE_ERROR 3 #define READ_ONLY_ERROR 4 #define GEN_ERROR 5
On SCO OpenServer, the parse_pdu routine is passed a packet
and length
argument, as follows:
Pdu *parse_pdu(u_char **packet, long *length)
On UnixWare 7 and SCO UnixWare 2.1.X, it is passed an AuthHeader structure:
Pdu *parse_pdu(AuthHeader *auth_ptr);typedef struct _AuthHeader { OctetString *packlet; unsigned long version; OctetString *community; } AuthHeader;
The routines are identical for applications compiled on SCO OpenServer with SNMPV1 or SNMPV1_ONLY set.