~jack/libtelnet-haskell

ref: 6a8d7db4d1faac82a15e2d9905dd61d5f13d8471 libtelnet-haskell/src/Network/Telnet/LibTelnet/Iac.hsc -rw-r--r-- 1.4 KiB
6a8d7db4Jack Kelly Documentation updates 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

{-|
Module      : Network.Telnet.LibTelnet.Iac
Description : Constants for interpret-as-command (IAC) codes
Copyright   : (c) 2017-2019 Jack Kelly
License     : GPL-3.0-or-later
Maintainer  : jack@jackkelly.name
Stability   : experimental
Portability : non-portable

Telnet interpret-as-command (IAC) codes. See
<http://www.faqs.org/rfcs/rfc854.html RFC 854> for the meaning of many of these.
-}

module Network.Telnet.LibTelnet.Iac
  ( Iac(..)
  , iacNull
  , iacIac
  , iacDont
  , iacDo
  , iacWont
  , iacWill
  , iacSB
  , iacGA
  , iacEL
  , iacEC
  , iacAYT
  , iacAO
  , iacIP
  , iacBreak
  , iacDM
  , iacNOP
  , iacSE
  , iacEOR
  , iacAbort
  , iacSusp
  , iacEOF
  ) where

import Foreign (Storable)
import Foreign.C (CUChar)

#include <libtelnet.h>

-- | Wrapper for telnet commands and special values.
newtype Iac = Iac { unIac :: CUChar } deriving (Eq, Show, Storable)
#{enum Iac, Iac
 , iacNull = 0
 , iacIac = TELNET_IAC
 , iacDont = TELNET_DONT
 , iacDo = TELNET_DO
 , iacWont = TELNET_WONT
 , iacWill = TELNET_WILL
 , iacSB = TELNET_SB
 , iacGA = TELNET_GA
 , iacEL = TELNET_EL
 , iacEC = TELNET_EC
 , iacAYT = TELNET_AYT
 , iacAO = TELNET_AO
 , iacIP = TELNET_IP
 , iacBreak = TELNET_BREAK
 , iacDM = TELNET_DM
 , iacNOP = TELNET_NOP
 , iacSE = TELNET_SE
 , iacEOR = TELNET_EOR
 , iacAbort = TELNET_ABORT
 , iacSusp = TELNET_SUSP
 , iacEOF = TELNET_EOF
 }