-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from o8x/core
Core
- Loading branch information
Showing
13 changed files
with
514 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#define ICMP_TYPE_ECHO_REQUEST 8 | ||
#define ICMP_TYPE_ECHO_REPLY 0 | ||
#define ICMP_TYPE_UNREACHABLE 3 | ||
#define ICMP_TYPE_SOURCE_CLOSED 4 | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
/** | ||
* +0------7-------15---------------31 | ||
* | Type | Code | Checksum | | ||
* +--------------------------------+ | ||
* | Message Body | | ||
* | (Variable length) | | ||
* +--------------------------------+ | ||
*/ | ||
typedef struct icmp_header { | ||
u_char type; | ||
u_char code; | ||
} ICMP_HEADER; | ||
|
||
// Echo Request/Reply | ||
typedef struct icmp_echo { | ||
icmp_header icmp_header; | ||
u_char identifier[2]; | ||
u_char seq_number[2]; | ||
// char data[1500]; // 数据不定长,但不会超过MTU | ||
} ICMP_ECHO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "dissectors/icmp.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.