Lines Matching refs:packet

70  * common_classify(packet, fid_table, slctrs_srchd)
76 common_classify(ipgpc_packet_t *packet, ht_match_t *fid_table,
81 /* Find on packet direction */
83 ipgpc_findfilters(IPGPC_TABLE_DIR, packet->direction, fid_table);
89 /* Find on IF_INDEX of packet */
91 ipgpc_findfilters(IPGPC_TABLE_IF, packet->if_index, fid_table);
99 ipgpc_findfilters(IPGPC_BA_DSID, packet->dsfield, fid_table);
105 /* Find on UID of packet */
107 ipgpc_findfilters(IPGPC_TABLE_UID, packet->uid, fid_table);
113 /* Find on PROJID of packet */
115 ipgpc_findfilters(IPGPC_TABLE_PROJID, packet->projid, fid_table);
122 if (packet->proto > 0) {
124 packet->proto, fid_table);
136 if (packet->sport > 0) {
138 packet->sport, fid_table);
150 if (packet->dport > 0) {
152 packet->dport, fid_table);
213 * ipgpc_classify(af, packet)
215 * The function that drives the packet classification algorithm. Given a
216 * address family (either AF_INET or AF_INET6) the input packet structure
225 ipgpc_classify(int af, ipgpc_packet_t *packet)
237 update_stats(ipgpc_def_class_id, packet->len);
250 rc = common_classify(packet, fid_table, &slctrs_srchd);
255 update_stats(ipgpc_def_class_id, packet->len);
266 V4_PART_OF_V6(packet->saddr), fid_table);
273 update_stats(ipgpc_def_class_id, packet->len);
282 V4_PART_OF_V6(packet->daddr), fid_table);
289 update_stats(ipgpc_def_class_id, packet->len);
300 packet->saddr, fid_table);
307 update_stats(ipgpc_def_class_id, packet->len);
316 packet->daddr, fid_table);
323 update_stats(ipgpc_def_class_id, packet->len);
344 update_stats(ipgpc_def_class_id, packet->len);
353 update_stats(class_id, packet->len);
476 * get_port_info(packet, iph, af, mp)
487 get_port_info(ipgpc_packet_t *packet, void *iph, int af, mblk_t *mp)
503 packet->sport = (uint16_t)*up++;
504 packet->dport = (uint16_t)*up;
555 packet->proto = *nexthdrp;
557 packet->sport = (uint16_t)*up++;
558 packet->dport = (uint16_t)*up;
565 packet->proto = *nexthdrp;
578 * find_ids(packet, mp)
580 * attempt to discern the uid and projid of the originator of a packet by
581 * looking at the dblks making up the packet - yeuch!
585 * whole packet. We also suck the projid from the same fragment.
588 find_ids(ipgpc_packet_t *packet, mblk_t *mp)
594 packet->uid = crgetuid(cr);
595 packet->projid = crgetprojid(cr);
597 packet->uid = (uid_t)-1;
598 packet->projid = -1;
603 * parse_packet(packet, mp)
608 parse_packet(ipgpc_packet_t *packet, mblk_t *mp)
614 V4_PART_OF_V6(packet->saddr) = (int32_t)ipha->ipha_src;
615 V4_PART_OF_V6(packet->daddr) = (int32_t)ipha->ipha_dst;
616 packet->dsfield = ipha->ipha_type_of_service;
617 packet->proto = ipha->ipha_protocol;
618 packet->sport = 0;
619 packet->dport = 0;
620 find_ids(packet, mp);
621 packet->len = msgdsize(mp);
623 if ((packet->proto == IPPROTO_TCP) || (packet->proto == IPPROTO_UDP) ||
624 (packet->proto == IPPROTO_SCTP)) {
625 get_port_info(packet, ipha, AF_INET, mp);
630 * parse_packet6(packet, mp)
635 parse_packet6(ipgpc_packet_t *packet, mblk_t *mp)
640 bcopy(ip6h->ip6_src.s6_addr32, packet->saddr.s6_addr32,
642 bcopy(ip6h->ip6_dst.s6_addr32, packet->daddr.s6_addr32,
645 packet->proto = ip6h->ip6_nxt;
646 packet->dsfield = __IPV6_TCLASS_FROM_FLOW(ip6h->ip6_vcf);
647 find_ids(packet, mp);
648 packet->len = msgdsize(mp);
649 packet->sport = 0;
650 packet->dport = 0;
660 get_port_info(packet, ip6h, AF_INET6, mp);
665 * print_packet(af, packet)
667 * prints the contents of the packet structure for specified address family