Lines Matching refs:header
109 flowacct_port_info(header_t *header, void *iph, int af, mblk_t *mp)
125 header->sport = (uint16_t)*up++;
126 header->dport = (uint16_t)*up;
169 * bytes of the ULP's header to get the port
177 header->proto = *nexthdrp;
179 header->sport = (uint16_t)*up++;
180 header->dport = (uint16_t)*up;
187 header->proto = *nexthdrp;
200 * flowacct_find_ids(mp, header)
210 flowacct_find_ids(mblk_t *mp, header_t *header)
216 header->uid = crgetuid(cr);
217 header->projid = crgetprojid(cr);
219 header->uid = (uid_t)-1;
220 header->projid = -1;
225 * Extract header information in a header_t structure so that we don't have
229 flowacct_extract_header(mblk_t *mp, header_t *header)
236 header->sport = 0;
237 header->dport = 0;
238 flowacct_find_ids(mp, header);
240 V6_SET_ZERO(header->saddr);
241 V6_SET_ZERO(header->daddr);
244 header->isv4 = IPH_HDR_VERSION(ipha) == IPV4_VERSION;
245 if (header->isv4) {
247 V4_PART_OF_V6(header->saddr) = (int32_t)ipha->ipha_src;
248 V4_PART_OF_V6(header->daddr) = (int32_t)ipha->ipha_dst;
249 header->dsfield = ipha->ipha_type_of_service;
250 header->proto = ipha->ipha_protocol;
251 header->pktlen = ntohs(ipha->ipha_length);
252 if ((header->proto == IPPROTO_TCP) ||
253 (header->proto == IPPROTO_UDP) ||
254 (header->proto == IPPROTO_SCTP)) {
255 flowacct_port_info(header, ipha, AF_INET, mp);
269 bcopy(ip6h->ip6_src.s6_addr32, header->saddr.s6_addr32,
271 bcopy(ip6h->ip6_dst.s6_addr32, header->daddr.s6_addr32,
273 header->dsfield = __IPV6_TCLASS_FROM_FLOW(ip6h->ip6_vcf);
274 header->proto = ip6h->ip6_nxt;
275 header->pktlen = ntohs(ip6h->ip6_plen) +
277 flowacct_port_info(header, ip6h, AF_INET6, mp);
286 flowacct_flow_present(header_t *header, int index,
295 (IN6_ARE_ADDR_EQUAL(&flow->saddr, &header->saddr)) &&
296 (IN6_ARE_ADDR_EQUAL(&flow->daddr, &header->daddr)) &&
297 (flow->proto == header->proto) &&
298 (flow->sport == header->sport) &&
299 (flow->dport == header->dport)) {
432 flowacct_update_flows_tbl(header_t *header, flowacct_data_t *flowacct_data)
443 index = FLOWACCT_FLOW_HASH(header);
450 flow = flowacct_flow_present(header, index, flowacct_data);
469 flow->isv4 = header->isv4;
470 bcopy(header->saddr.s6_addr32, flow->saddr.s6_addr32,
471 sizeof (header->saddr.s6_addr32));
472 bcopy(header->daddr.s6_addr32, flow->daddr.s6_addr32,
473 sizeof (header->daddr.s6_addr32));
474 flow->proto = header->proto;
475 flow->sport = header->sport;
476 flow->dport = header->dport;
489 item = flowacct_item_present(flow, header->dsfield, header->projid,
490 header->uid);
567 item->dsfield = header->dsfield;
568 item->projid = header->projid;
569 item->uid = header->uid;
571 item->nbytes = header->pktlen;
575 item->nbytes += header->pktlen;
638 atomic_add_64(&flowacct_data->tbytes, header->pktlen);
872 * Get the IP header contents from the packet, update the flow table with
878 header_t *header;
895 header = kmem_zalloc(FLOWACCT_HEADER_SZ, KM_NOSLEEP);
896 if (header == NULL) {
902 /* Get all the required information into header. */
903 if (flowacct_extract_header(mp, header) != 0) {
904 kmem_free(header, FLOWACCT_HEADER_SZ);
910 if (flowacct_update_flows_tbl(header, flowacct_data) != 0) {
911 kmem_free(header, FLOWACCT_HEADER_SZ);
918 atomic_add_64(&flowacct_data->nbytes, header->pktlen);
920 kmem_free(header, FLOWACCT_HEADER_SZ);