URL
https://opencores.org/ocsvn/1g_ethernet_dpi/1g_ethernet_dpi/trunk
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
4 |
kuzmi4 |
//////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Company:
|
3 |
|
|
// Engineer: IK
|
4 |
|
|
//
|
5 |
|
|
// Create Date: 11:35:01 03/21/2013
|
6 |
|
|
// Design Name:
|
7 |
|
|
// Module Name: pcap_pkg
|
8 |
|
|
// Project Name:
|
9 |
|
|
// Target Devices:
|
10 |
|
|
// Tool versions:
|
11 |
|
|
// Description:
|
12 |
|
|
//
|
13 |
|
|
//
|
14 |
|
|
// Revision:
|
15 |
|
|
// Revision 0.01 - File Created,
|
16 |
|
|
//
|
17 |
|
|
//////////////////////////////////////////////////////////////////////////////////
|
18 |
|
|
|
19 |
|
|
package pcap_pkg;
|
20 |
|
|
//////////////////////////////////////////////////////////////////////////////////
|
21 |
|
|
//
|
22 |
|
|
localparam pcap_hdr_sz = 6*4; // 6DW
|
23 |
|
|
typedef struct packed {
|
24 |
|
|
bit [31:0] magic_number; /* magic number */
|
25 |
|
|
bit [15:0] version_major; /* major version number */
|
26 |
|
|
bit [15:0] version_minor; /* minor version number */
|
27 |
|
|
bit [31:0] thiszone; /* GMT to local correction */
|
28 |
|
|
bit [31:0] sigfigs; /* accuracy of timestamps */
|
29 |
|
|
bit [31:0] snaplen; /* max length of captured packets, in octets */
|
30 |
|
|
bit [31:0] network; /* data link type */
|
31 |
|
|
} pcap_hdr_t;
|
32 |
|
|
typedef union packed {
|
33 |
|
|
pcap_hdr_t pcap_hdr;
|
34 |
|
|
bit [0:pcap_hdr_sz-1] [7:0] data;
|
35 |
|
|
//bit [pcap_hdr_sz-1:0] data;
|
36 |
|
|
} u_pcap_hdr_t;
|
37 |
|
|
//
|
38 |
|
|
localparam pcaprec_hdr_sz = 4*4; // 4DW
|
39 |
|
|
typedef struct packed {
|
40 |
|
|
bit [31:0] ts_sec; /* timestamp seconds */
|
41 |
|
|
bit [31:0] ts_usec; /* timestamp microseconds */
|
42 |
|
|
bit [31:0] incl_len; /* number of octets of packet saved in file */
|
43 |
|
|
bit [31:0] orig_len; /* actual length of packet */
|
44 |
|
|
} pcaprec_hdr_t;
|
45 |
|
|
typedef union packed {
|
46 |
|
|
pcaprec_hdr_t pcaprec_hdr;
|
47 |
|
|
bit [0:pcaprec_hdr_sz-1] [7:0] data;
|
48 |
|
|
} u_pcaprec_hdr_t;
|
49 |
|
|
//////////////////////////////////////////////////////////////////////////////////
|
50 |
|
|
endpackage : pcap_pkg
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.