Lines Matching refs:hdr
856 struct pcap_file_header hdr;
858 hdr.magic = TCPDUMP_MAGIC;
859 hdr.version_major = PCAP_VERSION_MAJOR;
860 hdr.version_minor = PCAP_VERSION_MINOR;
862 hdr.thiszone = thiszone;
863 hdr.snaplen = snaplen;
864 hdr.sigfigs = 0;
865 hdr.linktype = linktype;
867 if (fwrite((char *)&hdr, sizeof(hdr), 1, fp) != 1)
982 struct pcap_file_header hdr;
995 amt_read = fread((char *)&hdr, 1, sizeof(hdr), fp);
996 if (amt_read != sizeof(hdr)) {
1004 (unsigned long)sizeof(hdr),
1009 magic = hdr.magic;
1018 swap_hdr(&hdr);
1041 if (hdr.version_major < PCAP_VERSION_MAJOR) {
1045 p->tzoff = hdr.thiszone;
1046 p->snapshot = hdr.snaplen;
1047 p->linktype = linktype_to_dlt(hdr.linktype);
1072 p->bufsize = hdr.snaplen;
1075 p->bufsize = hdr.snaplen+sizeof(struct pcap_pkthdr);
1104 p->sf.version_major = hdr.version_major;
1105 p->sf.version_minor = hdr.version_minor;
1121 switch (hdr.version_major) {
1124 if (hdr.version_minor < 3)
1126 else if (hdr.version_minor == 3)
1169 * Read sf_readfile and return the next packet. Return the header in hdr
1174 sf_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char *buf, u_int buflen)
1209 hdr->caplen = SWAPLONG(sf_hdr.caplen);
1210 hdr->len = SWAPLONG(sf_hdr.len);
1211 hdr->ts.tv_sec = SWAPLONG(sf_hdr.ts.tv_sec);
1212 hdr->ts.tv_usec = SWAPLONG(sf_hdr.ts.tv_usec);
1214 hdr->caplen = sf_hdr.caplen;
1215 hdr->len = sf_hdr.len;
1216 hdr->ts.tv_sec = sf_hdr.ts.tv_sec;
1217 hdr->ts.tv_usec = sf_hdr.ts.tv_usec;
1226 if (hdr->caplen <= hdr->len) {
1236 t = hdr->caplen;
1237 hdr->caplen = hdr->len;
1238 hdr->len = t;
1242 if (hdr->caplen > buflen) {
1252 if (hdr->caplen > 65535) {
1258 if (tsize < hdr->caplen) {
1259 tsize = ((hdr->caplen + 1023) / 1024) * 1024;
1270 amt_read = fread((char *)tp, 1, hdr->caplen, fp);
1271 if (amt_read != hdr->caplen) {
1279 hdr->caplen, (unsigned long)amt_read);
1290 hdr->caplen = buflen;
1295 amt_read = fread((char *)buf, 1, hdr->caplen, fp);
1296 if (amt_read != hdr->caplen) {
1304 hdr->caplen, (unsigned long)amt_read);