MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpf_gettime

Function bpf_gettime

freebsd/net/bpf.c:2204–2227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2202}
2203
2204static int
2205bpf_gettime(struct bintime *bt, int tstype, struct mbuf *m)
2206{
2207 struct m_tag *tag;
2208 int quality;
2209
2210 quality = bpf_ts_quality(tstype);
2211 if (quality == BPF_TSTAMP_NONE)
2212 return (quality);
2213
2214 if (m != NULL) {
2215 tag = m_tag_locate(m, MTAG_BPF, MTAG_BPF_TIMESTAMP, NULL);
2216 if (tag != NULL) {
2217 *bt = *(struct bintime *)(tag + 1);
2218 return (BPF_TSTAMP_EXTERN);
2219 }
2220 }
2221 if (quality == BPF_TSTAMP_NORMAL)
2222 binuptime(bt);
2223 else
2224 getbinuptime(bt);
2225
2226 return (quality);
2227}
2228
2229/*
2230 * Incoming linkage from device drivers. Process the packet pkt, of length

Callers 3

bpf_tapFunction · 0.85
bpf_mtapFunction · 0.85
bpf_mtap2Function · 0.85

Calls 4

bpf_ts_qualityFunction · 0.85
m_tag_locateFunction · 0.85
binuptimeFunction · 0.85
getbinuptimeFunction · 0.85

Tested by

no test coverage detected