- All Implemented Interfaces:
Serializable
,Comparable<PcapCode>
,Constable
,IntSupplier
Libppcap error and warning status codes.
- Author:
- Sly Technologies, repos@slytechs.com
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptiongeneric error full.the operation can't be performed on already activated captures.loop terminated by pcap_breakloop.this device doesn't support setting the time stamp type.interface isn't up.no such device exists.the capture needs to be activated.operation supported only in monitor mode.no permission to open the device.you don't have permission to capture in promiscuous mode.this device doesn't support rfmon (monitor) mode.the requested time stamp precision is not supported.ok.generic warning.this device doesn't support promiscuous mode.the requested time stamp type is not supported. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
generic error full.static final int
the operation can't be performed on already activated captures.static final int
loop terminated by pcap_breakloop.static final int
this device doesn't support setting the time stamp type.static final int
interface isn't up.static final int
no such device exists.static final int
the capture needs to be activated.static final int
operation supported only in monitor mode.static final int
no permission to open the device.static final int
you don't have permission to capture in promiscuous mode.static final int
this device doesn't support rfmon (monitor) mode.static final int
the requested time stamp precision is not supported.static final int
ok.static final int
generic warning.static final int
this device doesn't support promiscuous mode.static final int
the requested time stamp type is not supported. -
Method Summary
Modifier and TypeMethodDescriptionint
getAsInt()
Gets the as int.Gets the message associated with this error code.static String
getMessage
(int code) Looks up the error message for a give code.boolean
isError()
Checks if this code is an pcap error.boolean
isOk()
Checks if this code is pcap status OK.boolean
Checks if this code is pcap status warning.toEnum
(int code) Converts an integer Pcap error code to a constant.static String
toString
(int code) Converts an integer Pcap error code to a string.static PcapCode
valueOf
(int code) Converts an integer Pcap error code to a constant.static PcapCode
Returns the enum constant of this class with the specified name.static PcapCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OK
ok. -
ERROR
generic error full. -
ERROR_BREAK
loop terminated by pcap_breakloop. -
ERROR_NOT_ACTIVATED
the capture needs to be activated. -
ERROR_ACTIVATED
the operation can't be performed on already activated captures. -
ERROR_NO_SUCH_DEVICE
no such device exists. -
ERROR_RFMON_NOTSUP
this device doesn't support rfmon (monitor) mode. -
ERROR_NOT_RFMON
operation supported only in monitor mode. -
ERROR_PERM_DENIED
no permission to open the device. -
ERROR_IFACE_NOT_UP
interface isn't up. -
ERROR_CANTSET_TSTAMP_TYPE
this device doesn't support setting the time stamp type. -
ERROR_PROMISC_PERM_DENIED
you don't have permission to capture in promiscuous mode. -
ERROR_TSTAMP_PRECISION_NOTSUP
the requested time stamp precision is not supported. -
WARNING
generic warning. -
WARNING_PROMISC_NOTSUP
this device doesn't support promiscuous mode. -
WARNING_TSTAMP_TYPE_NOTSUP
the requested time stamp type is not supported.
-
-
Field Details
-
PCAP_OK
public static final int PCAP_OKok.- See Also:
-
PCAP_ERROR
public static final int PCAP_ERRORgeneric error full.- See Also:
-
PCAP_ERROR_BREAK
public static final int PCAP_ERROR_BREAKloop terminated by pcap_breakloop.- See Also:
-
PCAP_ERROR_NOT_ACTIVATED
public static final int PCAP_ERROR_NOT_ACTIVATEDthe capture needs to be activated.- See Also:
-
PCAP_ERROR_ACTIVATED
public static final int PCAP_ERROR_ACTIVATEDthe operation can't be performed on already activated captures.- See Also:
-
PCAP_ERROR_NO_SUCH_DEVICE
public static final int PCAP_ERROR_NO_SUCH_DEVICEno such device exists.- See Also:
-
PCAP_ERROR_RFMON_NOTSUP
public static final int PCAP_ERROR_RFMON_NOTSUPthis device doesn't support rfmon (monitor) mode.- See Also:
-
PCAP_ERROR_NOT_RFMON
public static final int PCAP_ERROR_NOT_RFMONoperation supported only in monitor mode.- See Also:
-
PCAP_ERROR_PERM_DENIED
public static final int PCAP_ERROR_PERM_DENIEDno permission to open the device.- See Also:
-
PCAP_ERROR_IFACE_NOT_UP
public static final int PCAP_ERROR_IFACE_NOT_UPinterface isn't up.- See Also:
-
PCAP_ERROR_CANTSET_TSTAMP_TYPE
public static final int PCAP_ERROR_CANTSET_TSTAMP_TYPEthis device doesn't support setting the time stamp type.- See Also:
-
PCAP_ERROR_PROMISC_PERM_DENIED
public static final int PCAP_ERROR_PROMISC_PERM_DENIEDyou don't have permission to capture in promiscuous mode.- See Also:
-
PCAP_ERROR_TSTAMP_PRECISION_NOTSUP
public static final int PCAP_ERROR_TSTAMP_PRECISION_NOTSUPthe requested time stamp precision is not supported.- See Also:
-
PCAP_WARNING
public static final int PCAP_WARNINGgeneric warning.- See Also:
-
PCAP_WARNING_PROMISC_NOTSUP
public static final int PCAP_WARNING_PROMISC_NOTSUPthis device doesn't support promiscuous mode.- See Also:
-
PCAP_WARNING_TSTAMP_TYPE_NOTSUP
public static final int PCAP_WARNING_TSTAMP_TYPE_NOTSUPthe requested time stamp type is not supported.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
Converts an integer Pcap error code to a string.- Parameters:
code
- the code- Returns:
- the error code string or description
-
valueOf
Converts an integer Pcap error code to a constant.- Parameters:
code
- pcap error code- Returns:
- the matching constant or null if not found
- Throws:
IllegalArgumentException
- thrown if not found
-
toEnum
-
getAsInt
public int getAsInt()Gets the as int.- Specified by:
getAsInt
in interfaceIntSupplier
- Returns:
- the as int
- See Also:
-
getMessage
Gets the message associated with this error code.- Returns:
- the error code message
-
getMessage
Looks up the error message for a give code.- Parameters:
code
- the pcap code to lookup- Returns:
- the error code message
-
isError
public boolean isError()Checks if this code is an pcap error. For example,code < 0
- Returns:
- true, if is error
-
isOk
public boolean isOk()Checks if this code is pcap status OK. For example,code == 0
- Returns:
- true, if is ok
-
isWarning
public boolean isWarning()Checks if this code is pcap status warning. For example,code > 0
- Returns:
- true, if it is a wraning
-