PCAP_SET_DATALINK(3)
π PCAP_SET_DATALINK(3) π
okay bestie, welcome to the pcap_set_datalink page from the Library Functions Manual β¨ this one is lowkey short but highkey useful: it's all about setting the link-layer header type for a capture device. no cap π«Ά
β¨ NAME β¨
pcap_set_datalink β set the link-layer header type to be used by a capture device π
πΈ SYNOPSIS πΈ
#include <pcap/pcap.h>
int pcap_set_datalink(pcap_t *p, int dlt);
π DESCRIPTION π
so basically, pcap_set_datalink() is used to set the current link-layer header type of the pcap descriptor to the type specified by dlt π¦
like, that's the whole vibe. p is your pcap descriptor, and dlt is the link-layer header type you want it to use. iconic, honestly π
π₯ RETURN VALUE π₯
pcap_set_datalink() returns 0 on success, bestie π
it returns PCAP_ERROR_NOT_ACTIVATED if you call it on a capture handle that has been created but not activated π
on other errors, it returns PCAP_ERROR π
and if PCAP_ERROR is returned, you may call pcap_geterr(3) or pcap_perror(3) with p as an argument to fetch or display the error text. very helpful, very demure π
π SEE ALSO π
signed off from the Library Functions Manual, dated 5 March 2022, page PCAP_SET_DATALINK(3) β slay and goodbye, bestie πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1994, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms