14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (printf("\n%-25s %-6s %-25s %-6s %-10s %-10s %8s %8s\n", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "LADDR", "LPORT", "RADDR", "RPORT", "ISS", "IRS", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (printf("%-20s %-20s %-3s %15s %15s %8s %8s %5s\n", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "PROBENAME", "TIME", "S/R", "SEQ", "ACK", "DATALEN", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (printf("%-25s %-6d %-25s %-6d %-10d %-10d %8d %8d\n", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync send_count[self->conn_id], recv_count[self->conn_id]))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (printf("%-20s %-20Y %-3s %15d %15d %8d %8d %2x\n", \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* extract connection details */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (int)(((ipha_t *)self->iph)->ipha_version_and_hdr_length
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->tcph = (tcpha_t *)((char *)self->iph + this->iph_length);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (((tcph_t *)self->tcph)->th_offset_and_rsrvd[0] >>2) &(0xF << 2);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* ports */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->i_lport = ntohs(this->connp->u_port.tcpu_ports.tcpu_lport);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->i_fport = ntohs(this->connp->u_port.tcpu_ports.tcpu_fport);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* IP addresses */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync this->i_fad = (in6_addr_t *)&this->connp->connua_v6addr.connua_faddr;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync this->i_lad = (in6_addr_t *)&this->connp->connua_v6addr.connua_laddr;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* the address would either be IPv6 or IPv4-mapped-IPv6 */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->i_faddr = inet_ntop(AF_INET6, (void *)this->i_fad);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->i_laddr = inet_ntop(AF_INET6, (void *)this->i_lad);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* create connection identifier, so we can track packets by conn */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* initialize counters - this is the first packet for this connection */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* connection info */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* counters, to keep track of how much info to dump */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync rollover[self->conn_id] |= pcount[self->conn_id]/MAX_RECORDS;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync pcount[self->conn_id] = pcount[self->conn_id]%MAX_RECORDS;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync conn_time[self->conn_id, self->pcount] = walltimestamp;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* tcp state info */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync seqno[self->conn_id, self->pcount] = ntohl(self->tcph->tha_seq);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ack[self->conn_id, self->pcount] = ntohl(self->tcph->tha_ack);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync datalen[self->conn_id, self->pcount] = ntohs(self->iph->ipha_length);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync wnd[self->conn_id, self->pcount] = ntohs(self->tcph->tha_win);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync probe_name[self->conn_id, self->pcount] = probename;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* flag 0x04 indicates a RST packet */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync flags[self->conn_id, self->pcount] = self->tcph->tha_flags;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync self->i = (end_ptr[self->conn_id] + MAX_RECORDS - num[self->conn_id]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 10)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 9)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 8)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 7)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 6)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 5)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 4)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 3)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 2)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/(self->flags & TH_RST) && (num[self->conn_id] >= 1)/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* clear old connection state */