| 2202 | } |
| 2203 | |
| 2204 | static int |
| 2205 | bpf_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 |
no test coverage detected