package DPI;

require Exporter;
require DynaLoader;
require AutoLoader;

@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(

DPIawait_packet_from_agent
DPIconnect_to_agent_NMQ
DPIconnect_to_agent_TCP
DPIconnect_to_agent_UDP
DPIdisconnect_from_agent
DPIsend_packet_to_agent
DPIdebug
fDPIparse
fDPIset
mkDPIAreYouThere
mkDPIclose
mkDPIget
mkDPIhdr
mkDPIhdr_version
mkDPInext
mkDPIopen
mkDPIpacket
mkDPIregister
mkDPIresponse
mkDPIset
mkDPItrap
mkDPIunregister
pDPIpacket

DPI_ASCII_CSET
DPI_BULK_NO
DPI_BULK_YES
DPI_NATIVE_CSET
DPI_RC_EOF
DPI_RC_INVALID_HANDLE
DPI_RC_IO_ERROR
DPI_RC_NOK
DPI_RC_NO_CONNECTION
DPI_RC_NO_PORT
DPI_RC_OK
DPI_RC_PACKET_TOO_LARGE
DPI_RC_TIMEOUT
DPI_VIEW_NO
DPI_VIEW_YES
SNMP_CLOSE_authenticationFailure
SNMP_CLOSE_byManager
SNMP_CLOSE_goingDown
SNMP_CLOSE_openError
SNMP_CLOSE_otherReason
SNMP_CLOSE_protocolError
SNMP_CLOSE_timeout
SNMP_CLOSE_unsupportedVersion
SNMP_DPI_ARE_YOU_THERE
SNMP_DPI_BUFSIZE
SNMP_DPI_BULK_SELECTION
SNMP_DPI_CLOSE
SNMP_DPI_COMMIT
SNMP_DPI_GET
SNMP_DPI_GETBULK
SNMP_DPI_GETNEXT
SNMP_DPI_INFORM
SNMP_DPI_OPEN
SNMP_DPI_PROTOCOL
SNMP_DPI_REGISTER
SNMP_DPI_RELEASE
SNMP_DPI_RESPONSE
SNMP_DPI_SET
SNMP_DPI_TRAP
SNMP_DPI_TRAPV1
SNMP_DPI_TRAPV2
SNMP_DPI_UNDO
SNMP_DPI_UNREGISTER
SNMP_DPI_VERSION
SNMP_DPI_VIEW_SELECTION
SNMP_ERROR_DPI_alreadyRegistered
SNMP_ERROR_DPI_characterSetSelectionNotSupported
SNMP_ERROR_DPI_duplicateSubAgentIdentifier
SNMP_ERROR_DPI_getBulkSelectionNotSupported
SNMP_ERROR_DPI_higherPriorityRegistered
SNMP_ERROR_DPI_invalidDisplayString
SNMP_ERROR_DPI_mustOpenFirst
SNMP_ERROR_DPI_noError
SNMP_ERROR_DPI_notAuthorized
SNMP_ERROR_DPI_notFound
SNMP_ERROR_DPI_otherError
SNMP_ERROR_DPI_viewSelectionNotSupported
SNMP_ERROR_authorizationError
SNMP_ERROR_badValue
SNMP_ERROR_commitFailed
SNMP_ERROR_genErr
SNMP_ERROR_inconsistentName
SNMP_ERROR_inconsistentValue
SNMP_ERROR_noAccess
SNMP_ERROR_noCreation
SNMP_ERROR_noError
SNMP_ERROR_noSuchName
SNMP_ERROR_notWritable
SNMP_ERROR_readOnly
SNMP_ERROR_resourceUnavailable
SNMP_ERROR_tooBig
SNMP_ERROR_undoFailed
SNMP_ERROR_wrongEncoding
SNMP_ERROR_wrongLength
SNMP_ERROR_wrongType
SNMP_ERROR_wrongValue
SNMP_TYPE_BIT_STRING
SNMP_TYPE_Counter32
SNMP_TYPE_Counter64
SNMP_TYPE_DisplayString
SNMP_TYPE_Gauge32
SNMP_TYPE_Integer32
SNMP_TYPE_IpAddress
SNMP_TYPE_MASK
SNMP_TYPE_NULL
SNMP_TYPE_NsapAddress
SNMP_TYPE_OBJECT_IDENTIFIER
SNMP_TYPE_OCTET_STRING
SNMP_TYPE_Opaque
SNMP_TYPE_TimeTicks
SNMP_TYPE_UInteger32
SNMP_TYPE_endOfMibView
SNMP_TYPE_noSuchInstance
SNMP_TYPE_noSuchObject
SNMP_UNREGISTER_byManager
SNMP_UNREGISTER_goingDown
SNMP_UNREGISTER_higherPriorityRegistered
SNMP_UNREGISTER_justUnregister
SNMP_UNREGISTER_newRegistration
SNMP_UNREGISTER_otherReason
SNMP_UNREGISTER_timeout
dpiPortForTCP
dpiPortForUDP
);

sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()
    # XS function.  If a constant is not found then control is passed
    # to the AUTOLOAD in AutoLoader.

    local($constname);
    ($constname = $AUTOLOAD) =~ s/.*:://;
    $val = constant($constname, @_ ? $_[0] : 0);
    if ($! != 0) {
	if ($! =~ /Invalid/) {
	    $AutoLoader::AUTOLOAD = $AUTOLOAD;
	    goto &AutoLoader::AUTOLOAD;
	}
	else {
	    ($pack,$file,$line) = caller;
	    die "Your vendor has not defined DPI macro $constname, used at $file line $line.
";
	}
    }
    eval "sub $AUTOLOAD { $val }";
    goto &$AUTOLOAD;
}

bootstrap DPI;

# Preloaded methods go here.

# Autoload methods go after __END__, and are processed by the autosplit program.

1;
__END__
