1 #ifndef PACKETPP_TELNET_LAYER 2 #define PACKETPP_TELNET_LAYER 22 size_t lastPositionOffset;
25 bool isDataField(uint8_t *pos)
const;
27 bool isCommandField(uint8_t *pos)
const;
29 size_t distanceToNextIAC(uint8_t *startPos,
size_t maxLength);
31 size_t getFieldLen(uint8_t *startPos,
size_t maxLength);
33 uint8_t *getNextDataField(uint8_t *pos,
size_t len);
35 uint8_t *getNextCommandField(uint8_t *pos,
size_t len);
37 int16_t getSubCommand(uint8_t *pos,
size_t len);
39 uint8_t *getCommandData(uint8_t *pos,
size_t &slen);
109 TelnetOptionNoOption = -1,
120 ApproxMsgSizeNegotiation,
126 RemoteControlledTransAndEcho,
132 OutputCarriageReturnDisposition,
134 OutputHorizontalTabStops,
136 OutputHorizontalTabDisposition,
138 OutputFormfeedDisposition,
140 OutputVerticalTabStops,
142 OutputVerticalTabDisposition,
144 OutputLinefeedDisposition,
164 TACACSUserIdentification,
168 TerminalLocationNumber,
174 NegotiateAboutWindowSize,
186 AuthenticationOption,
190 NewEnvironmentOption,
198 TelnetRemoteSerialPort,
200 ComPortControlOption,
202 TelnetSuppressLocalEcho,
213 TelOptPragmaLogon = 138,
217 TelOptPragmaHeartbeat,
220 ExtendedOptions = 255
233 lastPositionOffset = SIZE_MAX;
323 static bool isDataValid(
const uint8_t *data,
size_t dataSize) {
return data && dataSize; }
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:333
Tells the recipient to interrupt, abort, suspend or terminate the process currently in use...
static std::string getTelnetOptionAsString(TelnetOption val)
void parseNextLayer()
Parses the next layer. Telnet is the always last so does nothing for this layer.
Definition: TelnetLayer.h:328
Definition: ProtocolType.h:348
size_t getTotalNumberOfCommands()
TelnetLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: TelnetLayer.h:230
Definition: TelnetLayer.h:18
OsiModelLayer getOsiModelLayer() const
Definition: TelnetLayer.h:341
std::string getDataAsString(bool removeEscapeCharacters=true)
Used to mark the end of a sequence of data that the recipient should scan for urgent Telnet commands...
std::string toString() const
const ProtocolType Telnet
Definition: ProtocolType.h:263
void computeCalculateFields()
Does nothing for this layer.
Definition: TelnetLayer.h:336
Represents the pressing of the “break” or “attention” key on the terminal.
Null command; does nothing.
Indicator to parser reached end of packet.
TelnetOption
Definition: TelnetLayer.h:106
static bool isDataValid(const uint8_t *data, size_t dataSize)
Definition: TelnetLayer.h:323
static bool isTelnetPort(uint16_t port)
Definition: TelnetLayer.h:315
size_t getNumberOfCommands(TelnetCommand command)
Used in Telnet half-duplex mode to signal the other device that it may transmit.
uint8_t * getOptionData(size_t &length)
size_t getHeaderLen() const
Definition: TelnetLayer.h:333
TelnetCommand getNextCommand()
TelnetCommand
Definition: TelnetLayer.h:45
TelnetCommand getFirstCommand()
static std::string getTelnetCommandAsString(TelnetCommand val)