module Network.Types.ICMP (
ICMPType(..)
, ICMPCodeNum(..)
, ICMPCode(..)
, icmpCodesForType
, icmpTypeToStringNum
, icmpTypeFromStringNum
, icmpTypeToNum
, icmpCodeToStringNum
, isICMPTypeDeprecated
) where
import Data.String (IsString)
import Data.Word (Word8)
import GHC.Generics
newtype ICMPTypeNum = ICMPTypeNum Word8
data ICMPType
= ICMPTypeUnknown
| ICMPType0EchoReply
| ICMPType3DestinationUnreachable
| ICMPType4SourceQuenchDeprecated
| ICMPType5Redirect
| ICMPType6AlternateHostAddressDeprecated
| ICMPType8Echo
| ICMPType9RouterAdvertisement
| ICMPType10RouterSolicitation
| ICMPType11TimeExceeded
| ICMPType12ParameterProblem
| ICMPType13Timestamp
| ICMPType14TimestampReply
| ICMPType15InformationRequestDeprecated
| ICMPType16InformationReplyDeprecated
| ICMPType17AddressMaskRequestDeprecated
| ICMPType18AddressMaskReplyDeprecated
| ICMPType19ReservedForSecurity
| ICMPType20ReservedForRobustnessExperiment
| ICMPType21ReservedForRobustnessExperiment
| ICMPType22ReservedForRobustnessExperiment
| ICMPType23ReservedForRobustnessExperiment
| ICMPType24ReservedForRobustnessExperiment
| ICMPType25ReservedForRobustnessExperiment
| ICMPType26ReservedForRobustnessExperiment
| ICMPType27ReservedForRobustnessExperiment
| ICMPType28ReservedForRobustnessExperiment
| ICMPType30TracerouteDeprecated
| ICMPType31DatagramConversionErrorDeprecated
| ICMPType32MobileHostRedirectDeprecated
| ICMPType33Ipv6WhereareyouDeprecated
| ICMPType34Ipv6IamhereDeprecated
| ICMPType35MobileRegistrationRequestDeprecated
| ICMPType36MobileRegistrationReplyDeprecated
| ICMPType37DomainNameRequestDeprecated
| ICMPType38DomainNameReplyDeprecated
| ICMPType39SkipDeprecated
| ICMPType40Photuris
| ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby
| ICMPType42ExtendedEchoRequest
| ICMPType43ExtendedEchoReply
| ICMPType253Rfc3692styleExperiment1
| ICMPType254Rfc3692styleExperiment2
| ICMPType255Reserved
deriving stock (ICMPType
ICMPType -> ICMPType -> Bounded ICMPType
forall a. a -> a -> Bounded a
maxBound :: ICMPType
$cmaxBound :: ICMPType
minBound :: ICMPType
$cminBound :: ICMPType
Bounded, ICMPType -> ICMPType -> Bool
(ICMPType -> ICMPType -> Bool)
-> (ICMPType -> ICMPType -> Bool) -> Eq ICMPType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ICMPType -> ICMPType -> Bool
$c/= :: ICMPType -> ICMPType -> Bool
== :: ICMPType -> ICMPType -> Bool
$c== :: ICMPType -> ICMPType -> Bool
Eq, Int -> ICMPType
ICMPType -> Int
ICMPType -> [ICMPType]
ICMPType -> ICMPType
ICMPType -> ICMPType -> [ICMPType]
ICMPType -> ICMPType -> ICMPType -> [ICMPType]
(ICMPType -> ICMPType)
-> (ICMPType -> ICMPType)
-> (Int -> ICMPType)
-> (ICMPType -> Int)
-> (ICMPType -> [ICMPType])
-> (ICMPType -> ICMPType -> [ICMPType])
-> (ICMPType -> ICMPType -> [ICMPType])
-> (ICMPType -> ICMPType -> ICMPType -> [ICMPType])
-> Enum ICMPType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ICMPType -> ICMPType -> ICMPType -> [ICMPType]
$cenumFromThenTo :: ICMPType -> ICMPType -> ICMPType -> [ICMPType]
enumFromTo :: ICMPType -> ICMPType -> [ICMPType]
$cenumFromTo :: ICMPType -> ICMPType -> [ICMPType]
enumFromThen :: ICMPType -> ICMPType -> [ICMPType]
$cenumFromThen :: ICMPType -> ICMPType -> [ICMPType]
enumFrom :: ICMPType -> [ICMPType]
$cenumFrom :: ICMPType -> [ICMPType]
fromEnum :: ICMPType -> Int
$cfromEnum :: ICMPType -> Int
toEnum :: Int -> ICMPType
$ctoEnum :: Int -> ICMPType
pred :: ICMPType -> ICMPType
$cpred :: ICMPType -> ICMPType
succ :: ICMPType -> ICMPType
$csucc :: ICMPType -> ICMPType
Enum, (forall x. ICMPType -> Rep ICMPType x)
-> (forall x. Rep ICMPType x -> ICMPType) -> Generic ICMPType
forall x. Rep ICMPType x -> ICMPType
forall x. ICMPType -> Rep ICMPType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ICMPType x -> ICMPType
$cfrom :: forall x. ICMPType -> Rep ICMPType x
Generic, Eq ICMPType
Eq ICMPType
-> (ICMPType -> ICMPType -> Ordering)
-> (ICMPType -> ICMPType -> Bool)
-> (ICMPType -> ICMPType -> Bool)
-> (ICMPType -> ICMPType -> Bool)
-> (ICMPType -> ICMPType -> Bool)
-> (ICMPType -> ICMPType -> ICMPType)
-> (ICMPType -> ICMPType -> ICMPType)
-> Ord ICMPType
ICMPType -> ICMPType -> Bool
ICMPType -> ICMPType -> Ordering
ICMPType -> ICMPType -> ICMPType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ICMPType -> ICMPType -> ICMPType
$cmin :: ICMPType -> ICMPType -> ICMPType
max :: ICMPType -> ICMPType -> ICMPType
$cmax :: ICMPType -> ICMPType -> ICMPType
>= :: ICMPType -> ICMPType -> Bool
$c>= :: ICMPType -> ICMPType -> Bool
> :: ICMPType -> ICMPType -> Bool
$c> :: ICMPType -> ICMPType -> Bool
<= :: ICMPType -> ICMPType -> Bool
$c<= :: ICMPType -> ICMPType -> Bool
< :: ICMPType -> ICMPType -> Bool
$c< :: ICMPType -> ICMPType -> Bool
compare :: ICMPType -> ICMPType -> Ordering
$ccompare :: ICMPType -> ICMPType -> Ordering
$cp1Ord :: Eq ICMPType
Ord, Int -> ICMPType -> ShowS
[ICMPType] -> ShowS
ICMPType -> String
(Int -> ICMPType -> ShowS)
-> (ICMPType -> String) -> ([ICMPType] -> ShowS) -> Show ICMPType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ICMPType] -> ShowS
$cshowList :: [ICMPType] -> ShowS
show :: ICMPType -> String
$cshow :: ICMPType -> String
showsPrec :: Int -> ICMPType -> ShowS
$cshowsPrec :: Int -> ICMPType -> ShowS
Show)
newtype ICMPCodeNum = ICMPCodeNum Word8
data ICMPCode
= ICMPCodeUnknown
| ICMPType0Code0
| ICMPType3Code0
| ICMPType3Code1
| ICMPType3Code2
| ICMPType3Code3
| ICMPType3Code4
| ICMPType3Code5
| ICMPType3Code6
| ICMPType3Code7
| ICMPType3Code8
| ICMPType3Code9
| ICMPType3Code10
| ICMPType3Code11
| ICMPType3Code12
| ICMPType3Code13
| ICMPType3Code14
| ICMPType3Code15
| ICMPType4Code0
| ICMPType5Code0
| ICMPType5Code1
| ICMPType5Code2
| ICMPType5Code3
| ICMPType6Code0
| ICMPType8Code0
| ICMPType9Code0
| ICMPType9Code16
| ICMPType10Code0
| ICMPType11Code0
| ICMPType11Code1
| ICMPType12Code0
| ICMPType12Code1
| ICMPType12Code2
| ICMPType13Code0
| ICMPType14Code0
| ICMPType15Code0
| ICMPType16Code0
| ICMPType17Code0
| ICMPType18Code0
| ICMPType40Code0
| ICMPType40Code1
| ICMPType40Code2
| ICMPType40Code3
| ICMPType40Code4
| ICMPType40Code5
| ICMPType42Code0
| ICMPType43Code0
| ICMPType43Code1
| ICMPType43Code2
| ICMPType43Code3
| ICMPType43Code4
deriving stock (ICMPCode
ICMPCode -> ICMPCode -> Bounded ICMPCode
forall a. a -> a -> Bounded a
maxBound :: ICMPCode
$cmaxBound :: ICMPCode
minBound :: ICMPCode
$cminBound :: ICMPCode
Bounded, ICMPCode -> ICMPCode -> Bool
(ICMPCode -> ICMPCode -> Bool)
-> (ICMPCode -> ICMPCode -> Bool) -> Eq ICMPCode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ICMPCode -> ICMPCode -> Bool
$c/= :: ICMPCode -> ICMPCode -> Bool
== :: ICMPCode -> ICMPCode -> Bool
$c== :: ICMPCode -> ICMPCode -> Bool
Eq, Int -> ICMPCode
ICMPCode -> Int
ICMPCode -> [ICMPCode]
ICMPCode -> ICMPCode
ICMPCode -> ICMPCode -> [ICMPCode]
ICMPCode -> ICMPCode -> ICMPCode -> [ICMPCode]
(ICMPCode -> ICMPCode)
-> (ICMPCode -> ICMPCode)
-> (Int -> ICMPCode)
-> (ICMPCode -> Int)
-> (ICMPCode -> [ICMPCode])
-> (ICMPCode -> ICMPCode -> [ICMPCode])
-> (ICMPCode -> ICMPCode -> [ICMPCode])
-> (ICMPCode -> ICMPCode -> ICMPCode -> [ICMPCode])
-> Enum ICMPCode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ICMPCode -> ICMPCode -> ICMPCode -> [ICMPCode]
$cenumFromThenTo :: ICMPCode -> ICMPCode -> ICMPCode -> [ICMPCode]
enumFromTo :: ICMPCode -> ICMPCode -> [ICMPCode]
$cenumFromTo :: ICMPCode -> ICMPCode -> [ICMPCode]
enumFromThen :: ICMPCode -> ICMPCode -> [ICMPCode]
$cenumFromThen :: ICMPCode -> ICMPCode -> [ICMPCode]
enumFrom :: ICMPCode -> [ICMPCode]
$cenumFrom :: ICMPCode -> [ICMPCode]
fromEnum :: ICMPCode -> Int
$cfromEnum :: ICMPCode -> Int
toEnum :: Int -> ICMPCode
$ctoEnum :: Int -> ICMPCode
pred :: ICMPCode -> ICMPCode
$cpred :: ICMPCode -> ICMPCode
succ :: ICMPCode -> ICMPCode
$csucc :: ICMPCode -> ICMPCode
Enum, (forall x. ICMPCode -> Rep ICMPCode x)
-> (forall x. Rep ICMPCode x -> ICMPCode) -> Generic ICMPCode
forall x. Rep ICMPCode x -> ICMPCode
forall x. ICMPCode -> Rep ICMPCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ICMPCode x -> ICMPCode
$cfrom :: forall x. ICMPCode -> Rep ICMPCode x
Generic, Eq ICMPCode
Eq ICMPCode
-> (ICMPCode -> ICMPCode -> Ordering)
-> (ICMPCode -> ICMPCode -> Bool)
-> (ICMPCode -> ICMPCode -> Bool)
-> (ICMPCode -> ICMPCode -> Bool)
-> (ICMPCode -> ICMPCode -> Bool)
-> (ICMPCode -> ICMPCode -> ICMPCode)
-> (ICMPCode -> ICMPCode -> ICMPCode)
-> Ord ICMPCode
ICMPCode -> ICMPCode -> Bool
ICMPCode -> ICMPCode -> Ordering
ICMPCode -> ICMPCode -> ICMPCode
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ICMPCode -> ICMPCode -> ICMPCode
$cmin :: ICMPCode -> ICMPCode -> ICMPCode
max :: ICMPCode -> ICMPCode -> ICMPCode
$cmax :: ICMPCode -> ICMPCode -> ICMPCode
>= :: ICMPCode -> ICMPCode -> Bool
$c>= :: ICMPCode -> ICMPCode -> Bool
> :: ICMPCode -> ICMPCode -> Bool
$c> :: ICMPCode -> ICMPCode -> Bool
<= :: ICMPCode -> ICMPCode -> Bool
$c<= :: ICMPCode -> ICMPCode -> Bool
< :: ICMPCode -> ICMPCode -> Bool
$c< :: ICMPCode -> ICMPCode -> Bool
compare :: ICMPCode -> ICMPCode -> Ordering
$ccompare :: ICMPCode -> ICMPCode -> Ordering
$cp1Ord :: Eq ICMPCode
Ord, Int -> ICMPCode -> ShowS
[ICMPCode] -> ShowS
ICMPCode -> String
(Int -> ICMPCode -> ShowS)
-> (ICMPCode -> String) -> ([ICMPCode] -> ShowS) -> Show ICMPCode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ICMPCode] -> ShowS
$cshowList :: [ICMPCode] -> ShowS
show :: ICMPCode -> String
$cshow :: ICMPCode -> String
showsPrec :: Int -> ICMPCode -> ShowS
$cshowsPrec :: Int -> ICMPCode -> ShowS
Show)
icmpCodesForType :: ICMPType -> [ICMPCode]
icmpCodesForType :: ICMPType -> [ICMPCode]
icmpCodesForType ICMPType
ty = case ICMPType
ty of
ICMPType
ICMPTypeUnknown -> []
ICMPType
ICMPType0EchoReply -> [
ICMPCode
ICMPType0Code0
]
ICMPType
ICMPType3DestinationUnreachable -> [
ICMPCode
ICMPType3Code0,
ICMPCode
ICMPType3Code1,
ICMPCode
ICMPType3Code2,
ICMPCode
ICMPType3Code3,
ICMPCode
ICMPType3Code4,
ICMPCode
ICMPType3Code5,
ICMPCode
ICMPType3Code6,
ICMPCode
ICMPType3Code7,
ICMPCode
ICMPType3Code8,
ICMPCode
ICMPType3Code9,
ICMPCode
ICMPType3Code10,
ICMPCode
ICMPType3Code11,
ICMPCode
ICMPType3Code12,
ICMPCode
ICMPType3Code13,
ICMPCode
ICMPType3Code14,
ICMPCode
ICMPType3Code15
]
ICMPType
ICMPType4SourceQuenchDeprecated -> [
ICMPCode
ICMPType4Code0
]
ICMPType
ICMPType5Redirect -> [
ICMPCode
ICMPType5Code0,
ICMPCode
ICMPType5Code1,
ICMPCode
ICMPType5Code2,
ICMPCode
ICMPType5Code3
]
ICMPType
ICMPType6AlternateHostAddressDeprecated -> [
ICMPCode
ICMPType6Code0
]
ICMPType
ICMPType8Echo -> [
ICMPCode
ICMPType8Code0
]
ICMPType
ICMPType9RouterAdvertisement -> [
ICMPCode
ICMPType9Code0,
ICMPCode
ICMPType9Code16
]
ICMPType
ICMPType10RouterSolicitation -> [
ICMPCode
ICMPType10Code0
]
ICMPType
ICMPType11TimeExceeded -> [
ICMPCode
ICMPType11Code0,
ICMPCode
ICMPType11Code1
]
ICMPType
ICMPType12ParameterProblem -> [
ICMPCode
ICMPType12Code0,
ICMPCode
ICMPType12Code1,
ICMPCode
ICMPType12Code2
]
ICMPType
ICMPType13Timestamp -> [
ICMPCode
ICMPType13Code0
]
ICMPType
ICMPType14TimestampReply -> [
ICMPCode
ICMPType14Code0
]
ICMPType
ICMPType15InformationRequestDeprecated -> [
ICMPCode
ICMPType15Code0
]
ICMPType
ICMPType16InformationReplyDeprecated -> [
ICMPCode
ICMPType16Code0
]
ICMPType
ICMPType17AddressMaskRequestDeprecated -> [
ICMPCode
ICMPType17Code0
]
ICMPType
ICMPType18AddressMaskReplyDeprecated -> [
ICMPCode
ICMPType18Code0
]
ICMPType
ICMPType19ReservedForSecurity -> [
]
ICMPType
ICMPType20ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType21ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType22ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType23ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType24ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType25ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType26ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType27ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType28ReservedForRobustnessExperiment -> [
]
ICMPType
ICMPType30TracerouteDeprecated -> [
]
ICMPType
ICMPType31DatagramConversionErrorDeprecated -> [
]
ICMPType
ICMPType32MobileHostRedirectDeprecated -> [
]
ICMPType
ICMPType33Ipv6WhereareyouDeprecated -> [
]
ICMPType
ICMPType34Ipv6IamhereDeprecated -> [
]
ICMPType
ICMPType35MobileRegistrationRequestDeprecated -> [
]
ICMPType
ICMPType36MobileRegistrationReplyDeprecated -> [
]
ICMPType
ICMPType37DomainNameRequestDeprecated -> [
]
ICMPType
ICMPType38DomainNameReplyDeprecated -> [
]
ICMPType
ICMPType39SkipDeprecated -> [
]
ICMPType
ICMPType40Photuris -> [
ICMPCode
ICMPType40Code0,
ICMPCode
ICMPType40Code1,
ICMPCode
ICMPType40Code2,
ICMPCode
ICMPType40Code3,
ICMPCode
ICMPType40Code4,
ICMPCode
ICMPType40Code5
]
ICMPType
ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby -> [
]
ICMPType
ICMPType42ExtendedEchoRequest -> [
ICMPCode
ICMPType42Code0
]
ICMPType
ICMPType43ExtendedEchoReply -> [
ICMPCode
ICMPType43Code0,
ICMPCode
ICMPType43Code1,
ICMPCode
ICMPType43Code2,
ICMPCode
ICMPType43Code3,
ICMPCode
ICMPType43Code4
]
ICMPType
ICMPType253Rfc3692styleExperiment1 -> [
]
ICMPType
ICMPType254Rfc3692styleExperiment2 -> [
]
ICMPType
ICMPType255Reserved -> [
]
icmpTypeToStringNum :: IsString a => ICMPType -> a
icmpTypeToStringNum :: ICMPType -> a
icmpTypeToStringNum ICMPType
t = case ICMPType
t of
ICMPType
ICMPType0EchoReply -> a
"0"
ICMPType
ICMPType3DestinationUnreachable -> a
"3"
ICMPType
ICMPType4SourceQuenchDeprecated -> a
"4"
ICMPType
ICMPType5Redirect -> a
"5"
ICMPType
ICMPType6AlternateHostAddressDeprecated -> a
"6"
ICMPType
ICMPType8Echo -> a
"8"
ICMPType
ICMPType9RouterAdvertisement -> a
"9"
ICMPType
ICMPType10RouterSolicitation -> a
"10"
ICMPType
ICMPType11TimeExceeded -> a
"11"
ICMPType
ICMPType12ParameterProblem -> a
"12"
ICMPType
ICMPType13Timestamp -> a
"13"
ICMPType
ICMPType14TimestampReply -> a
"14"
ICMPType
ICMPType15InformationRequestDeprecated -> a
"15"
ICMPType
ICMPType16InformationReplyDeprecated -> a
"16"
ICMPType
ICMPType17AddressMaskRequestDeprecated -> a
"17"
ICMPType
ICMPType18AddressMaskReplyDeprecated -> a
"18"
ICMPType
ICMPType19ReservedForSecurity -> a
"19"
ICMPType
ICMPType20ReservedForRobustnessExperiment -> a
"20"
ICMPType
ICMPType21ReservedForRobustnessExperiment -> a
"21"
ICMPType
ICMPType22ReservedForRobustnessExperiment -> a
"22"
ICMPType
ICMPType23ReservedForRobustnessExperiment -> a
"23"
ICMPType
ICMPType24ReservedForRobustnessExperiment -> a
"24"
ICMPType
ICMPType25ReservedForRobustnessExperiment -> a
"25"
ICMPType
ICMPType26ReservedForRobustnessExperiment -> a
"26"
ICMPType
ICMPType27ReservedForRobustnessExperiment -> a
"27"
ICMPType
ICMPType28ReservedForRobustnessExperiment -> a
"28"
ICMPType
ICMPType30TracerouteDeprecated -> a
"30"
ICMPType
ICMPType31DatagramConversionErrorDeprecated -> a
"31"
ICMPType
ICMPType32MobileHostRedirectDeprecated -> a
"32"
ICMPType
ICMPType33Ipv6WhereareyouDeprecated -> a
"33"
ICMPType
ICMPType34Ipv6IamhereDeprecated -> a
"34"
ICMPType
ICMPType35MobileRegistrationRequestDeprecated -> a
"35"
ICMPType
ICMPType36MobileRegistrationReplyDeprecated -> a
"36"
ICMPType
ICMPType37DomainNameRequestDeprecated -> a
"37"
ICMPType
ICMPType38DomainNameReplyDeprecated -> a
"38"
ICMPType
ICMPType39SkipDeprecated -> a
"39"
ICMPType
ICMPType40Photuris -> a
"40"
ICMPType
ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby -> a
"41"
ICMPType
ICMPType42ExtendedEchoRequest -> a
"42"
ICMPType
ICMPType43ExtendedEchoReply -> a
"43"
ICMPType
ICMPType253Rfc3692styleExperiment1 -> a
"253"
ICMPType
ICMPType254Rfc3692styleExperiment2 -> a
"254"
ICMPType
ICMPType255Reserved -> a
"255"
ICMPType
ICMPTypeUnknown -> a
"?"
icmpTypeFromStringNum :: (Eq a, IsString a) => a -> ICMPType
icmpTypeFromStringNum :: a -> ICMPType
icmpTypeFromStringNum a
s = case a
s of
a
"0" -> ICMPType
ICMPType0EchoReply
a
"3" -> ICMPType
ICMPType3DestinationUnreachable
a
"4" -> ICMPType
ICMPType4SourceQuenchDeprecated
a
"5" -> ICMPType
ICMPType5Redirect
a
"6" -> ICMPType
ICMPType6AlternateHostAddressDeprecated
a
"8" -> ICMPType
ICMPType8Echo
a
"9" -> ICMPType
ICMPType9RouterAdvertisement
a
"10" -> ICMPType
ICMPType10RouterSolicitation
a
"11" -> ICMPType
ICMPType11TimeExceeded
a
"12" -> ICMPType
ICMPType12ParameterProblem
a
"13" -> ICMPType
ICMPType13Timestamp
a
"14" -> ICMPType
ICMPType14TimestampReply
a
"15" -> ICMPType
ICMPType15InformationRequestDeprecated
a
"16" -> ICMPType
ICMPType16InformationReplyDeprecated
a
"17" -> ICMPType
ICMPType17AddressMaskRequestDeprecated
a
"18" -> ICMPType
ICMPType18AddressMaskReplyDeprecated
a
"19" -> ICMPType
ICMPType19ReservedForSecurity
a
"20" -> ICMPType
ICMPType20ReservedForRobustnessExperiment
a
"21" -> ICMPType
ICMPType21ReservedForRobustnessExperiment
a
"22" -> ICMPType
ICMPType22ReservedForRobustnessExperiment
a
"23" -> ICMPType
ICMPType23ReservedForRobustnessExperiment
a
"24" -> ICMPType
ICMPType24ReservedForRobustnessExperiment
a
"25" -> ICMPType
ICMPType25ReservedForRobustnessExperiment
a
"26" -> ICMPType
ICMPType26ReservedForRobustnessExperiment
a
"27" -> ICMPType
ICMPType27ReservedForRobustnessExperiment
a
"28" -> ICMPType
ICMPType28ReservedForRobustnessExperiment
a
"30" -> ICMPType
ICMPType30TracerouteDeprecated
a
"31" -> ICMPType
ICMPType31DatagramConversionErrorDeprecated
a
"32" -> ICMPType
ICMPType32MobileHostRedirectDeprecated
a
"33" -> ICMPType
ICMPType33Ipv6WhereareyouDeprecated
a
"34" -> ICMPType
ICMPType34Ipv6IamhereDeprecated
a
"35" -> ICMPType
ICMPType35MobileRegistrationRequestDeprecated
a
"36" -> ICMPType
ICMPType36MobileRegistrationReplyDeprecated
a
"37" -> ICMPType
ICMPType37DomainNameRequestDeprecated
a
"38" -> ICMPType
ICMPType38DomainNameReplyDeprecated
a
"39" -> ICMPType
ICMPType39SkipDeprecated
a
"40" -> ICMPType
ICMPType40Photuris
a
"41" -> ICMPType
ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby
a
"42" -> ICMPType
ICMPType42ExtendedEchoRequest
a
"43" -> ICMPType
ICMPType43ExtendedEchoReply
a
"253" -> ICMPType
ICMPType253Rfc3692styleExperiment1
a
"254" -> ICMPType
ICMPType254Rfc3692styleExperiment2
a
"255" -> ICMPType
ICMPType255Reserved
a
_ -> ICMPType
ICMPTypeUnknown
icmpTypeToNum :: ICMPType -> ICMPTypeNum
icmpTypeToNum :: ICMPType -> ICMPTypeNum
icmpTypeToNum ICMPType
t = case ICMPType
t of
ICMPType
ICMPType0EchoReply -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
0
ICMPType
ICMPType3DestinationUnreachable -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
3
ICMPType
ICMPType4SourceQuenchDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
4
ICMPType
ICMPType5Redirect -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
5
ICMPType
ICMPType6AlternateHostAddressDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
6
ICMPType
ICMPType8Echo -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
8
ICMPType
ICMPType9RouterAdvertisement -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
9
ICMPType
ICMPType10RouterSolicitation -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
10
ICMPType
ICMPType11TimeExceeded -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
11
ICMPType
ICMPType12ParameterProblem -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
12
ICMPType
ICMPType13Timestamp -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
13
ICMPType
ICMPType14TimestampReply -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
14
ICMPType
ICMPType15InformationRequestDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
15
ICMPType
ICMPType16InformationReplyDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
16
ICMPType
ICMPType17AddressMaskRequestDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
17
ICMPType
ICMPType18AddressMaskReplyDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
18
ICMPType
ICMPType19ReservedForSecurity -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
19
ICMPType
ICMPType20ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
20
ICMPType
ICMPType21ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
21
ICMPType
ICMPType22ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
22
ICMPType
ICMPType23ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
23
ICMPType
ICMPType24ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
24
ICMPType
ICMPType25ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
25
ICMPType
ICMPType26ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
26
ICMPType
ICMPType27ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
27
ICMPType
ICMPType28ReservedForRobustnessExperiment -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
28
ICMPType
ICMPType30TracerouteDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
30
ICMPType
ICMPType31DatagramConversionErrorDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
31
ICMPType
ICMPType32MobileHostRedirectDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
32
ICMPType
ICMPType33Ipv6WhereareyouDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
33
ICMPType
ICMPType34Ipv6IamhereDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
34
ICMPType
ICMPType35MobileRegistrationRequestDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
35
ICMPType
ICMPType36MobileRegistrationReplyDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
36
ICMPType
ICMPType37DomainNameRequestDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
37
ICMPType
ICMPType38DomainNameReplyDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
38
ICMPType
ICMPType39SkipDeprecated -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
39
ICMPType
ICMPType40Photuris -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
40
ICMPType
ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
41
ICMPType
ICMPType42ExtendedEchoRequest -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
42
ICMPType
ICMPType43ExtendedEchoReply -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
43
ICMPType
ICMPType253Rfc3692styleExperiment1 -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
253
ICMPType
ICMPType254Rfc3692styleExperiment2 -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
254
ICMPType
ICMPType255Reserved -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
255
ICMPType
ICMPTypeUnknown -> Word8 -> ICMPTypeNum
ICMPTypeNum Word8
0
isICMPTypeDeprecated :: ICMPType -> Bool
isICMPTypeDeprecated :: ICMPType -> Bool
isICMPTypeDeprecated ICMPType
ty = case ICMPType
ty of
ICMPType
ICMPType0EchoReply-> Bool
False
ICMPType
ICMPType3DestinationUnreachable-> Bool
False
ICMPType
ICMPType4SourceQuenchDeprecated-> Bool
True
ICMPType
ICMPType5Redirect-> Bool
False
ICMPType
ICMPType6AlternateHostAddressDeprecated-> Bool
True
ICMPType
ICMPType8Echo-> Bool
False
ICMPType
ICMPType9RouterAdvertisement-> Bool
False
ICMPType
ICMPType10RouterSolicitation-> Bool
False
ICMPType
ICMPType11TimeExceeded-> Bool
False
ICMPType
ICMPType12ParameterProblem-> Bool
False
ICMPType
ICMPType13Timestamp-> Bool
False
ICMPType
ICMPType14TimestampReply-> Bool
False
ICMPType
ICMPType15InformationRequestDeprecated-> Bool
True
ICMPType
ICMPType16InformationReplyDeprecated-> Bool
True
ICMPType
ICMPType17AddressMaskRequestDeprecated-> Bool
True
ICMPType
ICMPType18AddressMaskReplyDeprecated-> Bool
True
ICMPType
ICMPType19ReservedForSecurity-> Bool
False
ICMPType
ICMPType20ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType21ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType22ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType23ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType24ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType25ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType26ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType27ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType28ReservedForRobustnessExperiment-> Bool
False
ICMPType
ICMPType30TracerouteDeprecated-> Bool
True
ICMPType
ICMPType31DatagramConversionErrorDeprecated-> Bool
True
ICMPType
ICMPType32MobileHostRedirectDeprecated-> Bool
True
ICMPType
ICMPType33Ipv6WhereareyouDeprecated-> Bool
True
ICMPType
ICMPType34Ipv6IamhereDeprecated-> Bool
True
ICMPType
ICMPType35MobileRegistrationRequestDeprecated-> Bool
True
ICMPType
ICMPType36MobileRegistrationReplyDeprecated-> Bool
True
ICMPType
ICMPType37DomainNameRequestDeprecated-> Bool
True
ICMPType
ICMPType38DomainNameReplyDeprecated-> Bool
True
ICMPType
ICMPType39SkipDeprecated-> Bool
True
ICMPType
ICMPType40Photuris-> Bool
False
ICMPType
ICMPType41IcmpMessagesUtilizedByExperimentalMobilityProtocolsSuchAsSeamoby-> Bool
False
ICMPType
ICMPType42ExtendedEchoRequest-> Bool
False
ICMPType
ICMPType43ExtendedEchoReply-> Bool
False
ICMPType
ICMPType253Rfc3692styleExperiment1-> Bool
False
ICMPType
ICMPType254Rfc3692styleExperiment2-> Bool
False
ICMPType
ICMPType255Reserved-> Bool
False
ICMPType
ICMPTypeUnknown -> Bool
False
icmpCodeToStringNum :: IsString a => ICMPCode -> a
icmpCodeToStringNum :: ICMPCode -> a
icmpCodeToStringNum ICMPCode
t = case ICMPCode
t of
ICMPCode
ICMPType0Code0 -> a
"0"
ICMPCode
ICMPType3Code0 -> a
"0"
ICMPCode
ICMPType3Code1 -> a
"1"
ICMPCode
ICMPType3Code2 -> a
"2"
ICMPCode
ICMPType3Code3 -> a
"3"
ICMPCode
ICMPType3Code4 -> a
"4"
ICMPCode
ICMPType3Code5 -> a
"5"
ICMPCode
ICMPType3Code6 -> a
"6"
ICMPCode
ICMPType3Code7 -> a
"7"
ICMPCode
ICMPType3Code8 -> a
"8"
ICMPCode
ICMPType3Code9 -> a
"9"
ICMPCode
ICMPType3Code10 -> a
"10"
ICMPCode
ICMPType3Code11 -> a
"11"
ICMPCode
ICMPType3Code12 -> a
"12"
ICMPCode
ICMPType3Code13 -> a
"13"
ICMPCode
ICMPType3Code14 -> a
"14"
ICMPCode
ICMPType3Code15 -> a
"15"
ICMPCode
ICMPType4Code0 -> a
"0"
ICMPCode
ICMPType5Code0 -> a
"0"
ICMPCode
ICMPType5Code1 -> a
"1"
ICMPCode
ICMPType5Code2 -> a
"2"
ICMPCode
ICMPType5Code3 -> a
"3"
ICMPCode
ICMPType6Code0 -> a
"0"
ICMPCode
ICMPType8Code0 -> a
"0"
ICMPCode
ICMPType9Code0 -> a
"0"
ICMPCode
ICMPType9Code16 -> a
"16"
ICMPCode
ICMPType10Code0 -> a
"0"
ICMPCode
ICMPType11Code0 -> a
"0"
ICMPCode
ICMPType11Code1 -> a
"1"
ICMPCode
ICMPType12Code0 -> a
"0"
ICMPCode
ICMPType12Code1 -> a
"1"
ICMPCode
ICMPType12Code2 -> a
"2"
ICMPCode
ICMPType13Code0 -> a
"0"
ICMPCode
ICMPType14Code0 -> a
"0"
ICMPCode
ICMPType15Code0 -> a
"0"
ICMPCode
ICMPType16Code0 -> a
"0"
ICMPCode
ICMPType17Code0 -> a
"0"
ICMPCode
ICMPType18Code0 -> a
"0"
ICMPCode
ICMPType40Code0 -> a
"0"
ICMPCode
ICMPType40Code1 -> a
"1"
ICMPCode
ICMPType40Code2 -> a
"2"
ICMPCode
ICMPType40Code3 -> a
"3"
ICMPCode
ICMPType40Code4 -> a
"4"
ICMPCode
ICMPType40Code5 -> a
"5"
ICMPCode
ICMPType42Code0 -> a
"0"
ICMPCode
ICMPType43Code0 -> a
"0"
ICMPCode
ICMPType43Code1 -> a
"1"
ICMPCode
ICMPType43Code2 -> a
"2"
ICMPCode
ICMPType43Code3 -> a
"3"
ICMPCode
ICMPType43Code4 -> a
"4"
ICMPCode
ICMPCodeUnknown -> a
"?"