Revision 4e68f7a0 net/dump.c
b/net/dump.c | ||
---|---|---|
30 | 30 |
#include "hub.h" |
31 | 31 |
|
32 | 32 |
typedef struct DumpState { |
33 |
VLANClientState nc;
|
|
33 |
NetClientState nc;
|
|
34 | 34 |
int64_t start_ts; |
35 | 35 |
int fd; |
36 | 36 |
int pcap_caplen; |
... | ... | |
57 | 57 |
uint32_t len; |
58 | 58 |
}; |
59 | 59 |
|
60 |
static ssize_t dump_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
|
|
60 |
static ssize_t dump_receive(NetClientState *nc, const uint8_t *buf, size_t size)
|
|
61 | 61 |
{ |
62 | 62 |
DumpState *s = DO_UPCAST(DumpState, nc, nc); |
63 | 63 |
struct pcap_sf_pkthdr hdr; |
... | ... | |
86 | 86 |
return size; |
87 | 87 |
} |
88 | 88 |
|
89 |
static void dump_cleanup(VLANClientState *nc)
|
|
89 |
static void dump_cleanup(NetClientState *nc)
|
|
90 | 90 |
{ |
91 | 91 |
DumpState *s = DO_UPCAST(DumpState, nc, nc); |
92 | 92 |
|
... | ... | |
100 | 100 |
.cleanup = dump_cleanup, |
101 | 101 |
}; |
102 | 102 |
|
103 |
static int net_dump_init(VLANClientState *peer, const char *device,
|
|
103 |
static int net_dump_init(NetClientState *peer, const char *device,
|
|
104 | 104 |
const char *name, const char *filename, int len) |
105 | 105 |
{ |
106 | 106 |
struct pcap_file_hdr hdr; |
107 |
VLANClientState *nc;
|
|
107 |
NetClientState *nc;
|
|
108 | 108 |
DumpState *s; |
109 | 109 |
struct tm tm; |
110 | 110 |
int fd; |
... | ... | |
146 | 146 |
} |
147 | 147 |
|
148 | 148 |
int net_init_dump(const NetClientOptions *opts, const char *name, |
149 |
VLANClientState *peer)
|
|
149 |
NetClientState *peer)
|
|
150 | 150 |
{ |
151 | 151 |
int len; |
152 | 152 |
const char *file; |
Also available in: Unified diff