/* Initialize so that sf_write() will output to the given stream.  */
pcap_dumper_t* pcap_dump_fopen(pcap_t *p, FILE *f)
/* Initialize so that sf_write() will output to the given stream.  */
pcap_dumper_t* pcap_dump_fopen(pcap_t *p, FILE *f)
{
	int linktype;
	linktype = dlt_to_linktype(p->linktype);
	if (linktype == -1) {
		pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
		    "stream: link-layer type %d isn't supported in savefiles",
		    p->linktype);
		return (NULL);
	}
	linktype |= p->linktype_ext;
	return (pcap_setup_dump(p, linktype, f, "stream"));
}