/* **************************************************************** Copyright (c) 1992, Carnegie Mellon University All Rights Reserved Permission is hereby granted to use, copy, modify, and distribute this software provided that the above copyright notice appears in all copies and that any distribution be for noncommercial purposes. Carnegie Mellon University disclaims all warranties with regard to this software. In no event shall Carnegie Mellon University be liable for any special, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data, or profits arising out of or in connection with the use or performance of this software. **************************************************************** */ /* header file for UCI netstat program for CMU TCP/IP most of these definitions are lifted from NETCNTRL.REQ */ /* TCP function codes */ #define TCP$DUMP IO$_UNLOAD #define GTHST IO$_SKIPFILE /* Dump codes */ #define LOCAL_CONN_ID 3 #define TCB_DUMP 4 #define UDP_CONN 8 #define UCB_DUMP 9 /* Connection states */ #define CS$CLOSED 0 /* (not a real state) */ #define CS$LISTEN 1 /* Waiting for SYN */ #define CS$SYN_SENT 2 /* SYN sent, waiting for SYN-ACK */ #define CS$SYN_RECV 3 /* SYN received & sent, waiting for ACK */ #define CS$ESTABLISHED 4 /* Connection ready to send/receive data */ #define CS$FIN_WAIT_1 5 /* CLOSE done, FIN sent, waiting for ACK */ #define CS$FIN_WAIT_2 6 /* ACK of FIN received, waiting for FIN */ #define CS$TIME_WAIT 7 /* FINs sent,received,ACKed */ #define CS$CLOSE_WAIT 8 /* FIN received, waiting for user CLOSE */ #define CS$CLOSING 9 /* FINs sent&received, waiting for ACK * */ #define CS$LAST_ACK 10 /* FINs sent&received, waiting for ACK ** */ /* * State only reached via FIN-WAIT-1 (local initiation of close) ** State only reached via CLOSE-WAIT (remote initiation of close) */ /* TCP TCB sizes and struct */ #define CONECT_TBL_SIZE 30 #define MAX_TCB CONECT_TBL_SIZE*2 #define LC_ID_BLKSIZE MAX_TCB*4 struct tcb_fields { int tcb_addr; int user_id; short state; short last_state; int foreign_host; int foreign_port; int local_host; int local_port; int user_recv_qe; int user_send_qe; int net_recv_qe; int future_qe; int rexmit_qe; int dasm_ptr; int dasm_bc; int asm_ptr; int asm_bc; int iss; int snd_una; int snd_nxt; int snd_wnd; int snd_wl; int snd_bs; int irs; int rcv_nxt; int rcv_wnd; int rcv_bs; int conn_timeout; int rt_timeout; int round_trip_time; }; /* UDP UCB sizes and struct */ #define MAX_UCB 100 #define UCB_BLKSIZ MAX_UCB * 4 struct ucb_fields { int ucb_address; int foreign_host; int foreign_port; int local_host; int local_port; int nr_qcount; int ur_qcount; short flags; int user_id; }; #define ucb_size sizeof(ucb_fields)