1*a2f04351SSebastien Roy /* 2*a2f04351SSebastien Roy * CDDL HEADER START 3*a2f04351SSebastien Roy * 4*a2f04351SSebastien Roy * This file and its contents are supplied under the terms of the 5*a2f04351SSebastien Roy * Common Development and Distribution License ("CDDL"), version 1.0. 6*a2f04351SSebastien Roy * You may only use this file in accordance with the terms of version 7*a2f04351SSebastien Roy * 1.0 of the CDDL. 8*a2f04351SSebastien Roy * 9*a2f04351SSebastien Roy * A full copy of the text of the CDDL should have accompanied this 10*a2f04351SSebastien Roy * source. A copy of the CDDL is also available via the Internet at 11*a2f04351SSebastien Roy * http://www.illumos.org/license/CDDL. 12*a2f04351SSebastien Roy * 13*a2f04351SSebastien Roy * CDDL HEADER END 14*a2f04351SSebastien Roy */ 15*a2f04351SSebastien Roy /* 16*a2f04351SSebastien Roy * Copyright (c) 2015, 2016 by Delphix. All rights reserved. 17*a2f04351SSebastien Roy */ 18*a2f04351SSebastien Roy 19*a2f04351SSebastien Roy #ifndef _CONNSTAT_TCP_H 20*a2f04351SSebastien Roy #define _CONNSTAT_TCP_H 21*a2f04351SSebastien Roy 22*a2f04351SSebastien Roy #include <stddef.h> 23*a2f04351SSebastien Roy #include "connstat.h" 24*a2f04351SSebastien Roy 25*a2f04351SSebastien Roy #ifdef __cplusplus 26*a2f04351SSebastien Roy extern "C" { 27*a2f04351SSebastien Roy #endif 28*a2f04351SSebastien Roy 29*a2f04351SSebastien Roy int tcp_str2state(const char *state); 30*a2f04351SSebastien Roy connstat_getfieldsfunc_t tcp_get_fields; 31*a2f04351SSebastien Roy connstat_walkfunc_t tcp_walk_ipv4, tcp_walk_ipv6; 32*a2f04351SSebastien Roy 33*a2f04351SSebastien Roy /* 34*a2f04351SSebastien Roy * Keep the default output to < 80 columns. For most interactive workflows, 35*a2f04351SSebastien Roy * the user will run the command without arguments to get an idea of what 36*a2f04351SSebastien Roy * connections exist before narrowing down the investigation to a single 37*a2f04351SSebastien Roy * connection (with filtering) and specifying additional fields to output 38*a2f04351SSebastien Roy * depending on what the user is interested in. 39*a2f04351SSebastien Roy */ 40*a2f04351SSebastien Roy #define TCP_DEFAULT_FIELDS "laddr,lport,raddr,rport,state" 41*a2f04351SSebastien Roy 42*a2f04351SSebastien Roy #define CONNSTAT_TCP_PROTO \ 43*a2f04351SSebastien Roy { "tcp", TCP_DEFAULT_FIELDS, MIB2_TCP, MIB2_TCP_CONN, MIB2_TCP6_CONN, \ 44*a2f04351SSebastien Roy tcp_get_fields, tcp_walk_ipv4, tcp_walk_ipv6 } 45*a2f04351SSebastien Roy 46*a2f04351SSebastien Roy #ifdef __cplusplus 47*a2f04351SSebastien Roy } 48*a2f04351SSebastien Roy #endif 49*a2f04351SSebastien Roy 50*a2f04351SSebastien Roy #endif /* _CONNSTAT_TCP_H */ 51