-
Notifications
You must be signed in to change notification settings - Fork 0
/
EthPacketDump.h
47 lines (37 loc) · 1.09 KB
/
EthPacketDump.h
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
/*
* EthpacketDump.h
* Ethernet packet dump library header
*/
#ifndef _ETHPACKETDUMP_LIB_H
#define _ETHPACKETDUMP_LIB_H
#include <inttypes.h>
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <wprogram.h>
#endif
#include <avr/pgmspace.h>
/* Any #defines */
class EthPacketDump {
private:
HardwareSerial *_Serial;
void print( const prog_char *progmem_s );
void println( const prog_char *progmem_s );
void printIP( uint8_t *buf, int startByte );
void printMac( uint8_t *buf, int startByte );
void dumpHexAscii( uint8_t *buf, int offset, int payloadLen );
void dumpHex( uint8_t *buf, int plen );
void dumpEthernetHeader( uint8_t *buf );
void dumpArp( uint8_t *buf );
void dumpIpHeader( uint8_t *buf );
void dumpTcp( uint8_t *buf );
void dumpDns( uint8_t *buf, int plen );
void dumpDhcp( uint8_t *buf );
void dumpNtp( uint8_t *buf );
public:
EthPacketDump( void );
void begin( HardwareSerial *serIn, boolean dumpPacket, boolean ethernetDump,
boolean arpDump, boolean packetDetails, int packetBufSize );
void packetDump( uint8_t *buf, int plen );
};
#endif //_ETHPACKETDUMP_H