Lines Matching refs:header

109 flowacct_port_info(header_t *header, void *iph, int af, mblk_t *mp)  in flowacct_port_info()  argument
125 header->sport = (uint16_t)*up++; in flowacct_port_info()
126 header->dport = (uint16_t)*up; in flowacct_port_info()
177 header->proto = *nexthdrp; in flowacct_port_info()
179 header->sport = (uint16_t)*up++; in flowacct_port_info()
180 header->dport = (uint16_t)*up; in flowacct_port_info()
187 header->proto = *nexthdrp; in flowacct_port_info()
210 flowacct_find_ids(mblk_t *mp, header_t *header) in flowacct_find_ids() argument
216 header->uid = crgetuid(cr); in flowacct_find_ids()
217 header->projid = crgetprojid(cr); in flowacct_find_ids()
219 header->uid = (uid_t)-1; in flowacct_find_ids()
220 header->projid = -1; in flowacct_find_ids()
229 flowacct_extract_header(mblk_t *mp, header_t *header) in flowacct_extract_header() argument
236 header->sport = 0; in flowacct_extract_header()
237 header->dport = 0; in flowacct_extract_header()
238 flowacct_find_ids(mp, header); in flowacct_extract_header()
240 V6_SET_ZERO(header->saddr); in flowacct_extract_header()
241 V6_SET_ZERO(header->daddr); in flowacct_extract_header()
244 header->isv4 = IPH_HDR_VERSION(ipha) == IPV4_VERSION; in flowacct_extract_header()
245 if (header->isv4) { in flowacct_extract_header()
247 V4_PART_OF_V6(header->saddr) = (int32_t)ipha->ipha_src; in flowacct_extract_header()
248 V4_PART_OF_V6(header->daddr) = (int32_t)ipha->ipha_dst; in flowacct_extract_header()
249 header->dsfield = ipha->ipha_type_of_service; in flowacct_extract_header()
250 header->proto = ipha->ipha_protocol; in flowacct_extract_header()
251 header->pktlen = ntohs(ipha->ipha_length); in flowacct_extract_header()
252 if ((header->proto == IPPROTO_TCP) || in flowacct_extract_header()
253 (header->proto == IPPROTO_UDP) || in flowacct_extract_header()
254 (header->proto == IPPROTO_SCTP)) { in flowacct_extract_header()
255 flowacct_port_info(header, ipha, AF_INET, mp); in flowacct_extract_header()
269 bcopy(ip6h->ip6_src.s6_addr32, header->saddr.s6_addr32, in flowacct_extract_header()
271 bcopy(ip6h->ip6_dst.s6_addr32, header->daddr.s6_addr32, in flowacct_extract_header()
273 header->dsfield = __IPV6_TCLASS_FROM_FLOW(ip6h->ip6_vcf); in flowacct_extract_header()
274 header->proto = ip6h->ip6_nxt; in flowacct_extract_header()
275 header->pktlen = ntohs(ip6h->ip6_plen) + in flowacct_extract_header()
277 flowacct_port_info(header, ip6h, AF_INET6, mp); in flowacct_extract_header()
286 flowacct_flow_present(header_t *header, int index, in flowacct_flow_present() argument
295 (IN6_ARE_ADDR_EQUAL(&flow->saddr, &header->saddr)) && in flowacct_flow_present()
296 (IN6_ARE_ADDR_EQUAL(&flow->daddr, &header->daddr)) && in flowacct_flow_present()
297 (flow->proto == header->proto) && in flowacct_flow_present()
298 (flow->sport == header->sport) && in flowacct_flow_present()
299 (flow->dport == header->dport)) { in flowacct_flow_present()
432 flowacct_update_flows_tbl(header_t *header, flowacct_data_t *flowacct_data) in flowacct_update_flows_tbl() argument
443 index = FLOWACCT_FLOW_HASH(header); in flowacct_update_flows_tbl()
450 flow = flowacct_flow_present(header, index, flowacct_data); in flowacct_update_flows_tbl()
469 flow->isv4 = header->isv4; in flowacct_update_flows_tbl()
470 bcopy(header->saddr.s6_addr32, flow->saddr.s6_addr32, in flowacct_update_flows_tbl()
471 sizeof (header->saddr.s6_addr32)); in flowacct_update_flows_tbl()
472 bcopy(header->daddr.s6_addr32, flow->daddr.s6_addr32, in flowacct_update_flows_tbl()
473 sizeof (header->daddr.s6_addr32)); in flowacct_update_flows_tbl()
474 flow->proto = header->proto; in flowacct_update_flows_tbl()
475 flow->sport = header->sport; in flowacct_update_flows_tbl()
476 flow->dport = header->dport; in flowacct_update_flows_tbl()
489 item = flowacct_item_present(flow, header->dsfield, header->projid, in flowacct_update_flows_tbl()
490 header->uid); in flowacct_update_flows_tbl()
567 item->dsfield = header->dsfield; in flowacct_update_flows_tbl()
568 item->projid = header->projid; in flowacct_update_flows_tbl()
569 item->uid = header->uid; in flowacct_update_flows_tbl()
571 item->nbytes = header->pktlen; in flowacct_update_flows_tbl()
575 item->nbytes += header->pktlen; in flowacct_update_flows_tbl()
638 atomic_add_64(&flowacct_data->tbytes, header->pktlen); in flowacct_update_flows_tbl()
878 header_t *header; in flowacct_process() local
895 header = kmem_zalloc(FLOWACCT_HEADER_SZ, KM_NOSLEEP); in flowacct_process()
896 if (header == NULL) { in flowacct_process()
903 if (flowacct_extract_header(mp, header) != 0) { in flowacct_process()
904 kmem_free(header, FLOWACCT_HEADER_SZ); in flowacct_process()
910 if (flowacct_update_flows_tbl(header, flowacct_data) != 0) { in flowacct_process()
911 kmem_free(header, FLOWACCT_HEADER_SZ); in flowacct_process()
918 atomic_add_64(&flowacct_data->nbytes, header->pktlen); in flowacct_process()
920 kmem_free(header, FLOWACCT_HEADER_SZ); in flowacct_process()