Changeset 37369 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 7, 2011 10:32:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/Pcap.cpp
r35346 r37369 5 5 6 6 /* 7 * Copyright (C) 2006-20 08Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 uint32_t u32Magic; 60 60 struct pcap_hdr pcap; 61 struct pcaprec_hdr rec0;62 61 }; 63 62 … … 70 69 PCAP_MAGIC, 71 70 { 2, 4, 0, 0, 0xffff, 1 }, 72 /* force ethereal to start at 0.000000. */ 73 { 0, 1, 0, 60 } 74 75 }; 76 71 }; 72 73 static const char s_szDummyData[] = { 0, 0, 0, 0 }; 77 74 78 75 /** … … 109 106 int PcapStreamHdr(PRTSTREAM pStream, uint64_t StartNanoTS) 110 107 { 111 pcaprec_hdr_init Hdr = s_Hdr;112 pcapCalcHeader(&Hdr.rec0, StartNanoTS, 60, 0);113 return RT StrmWrite(pStream, &Hdr, sizeof(Hdr));108 int rc1 = RTStrmWrite(pStream, &s_Hdr, sizeof(s_Hdr)); 109 int rc2 = PcapStreamFrame(pStream, StartNanoTS, s_szDummyData, 60, sizeof(s_szDummyData)); 110 return RT_SUCCESS(rc1) ? rc2 : rc1; 114 111 } 115 112 … … 189 186 int PcapFileHdr(RTFILE File, uint64_t StartNanoTS) 190 187 { 191 pcaprec_hdr_init Hdr = s_Hdr;192 pcapCalcHeader(&Hdr.rec0, StartNanoTS, 60, 0);193 return RT FileWrite(File, &Hdr, sizeof(Hdr), NULL);188 int rc1 = RTFileWrite(File, &s_Hdr, sizeof(s_Hdr), NULL); 189 int rc2 = PcapFileFrame(File, StartNanoTS, s_szDummyData, 60, sizeof(s_szDummyData)); 190 return RT_SUCCESS(rc1) ? rc2 : rc1; 194 191 } 195 192
Note:
See TracChangeset
for help on using the changeset viewer.