/* sunscreen.h * * $Id: sunscreen.h,v 1.8 2000/08/11 13:32:34 deniel Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef __W_SUNSCREEN_H__ #define __W_SUNSCREEN_H__ #include int sunscreen_open(wtap *wth, int *err); gboolean sunscreen_dump_open(wtap_dumper *wdh, int *err); int sunscreen_dump_can_write_encap(int filetype, int encap); #endif /* since there is no single data structure which we can use to encapsulate the data which must be writtem to the file, we need to create one using the record header and screen packet types */ struct sunscreen_newdata_record { uint32_t orig_len; /* actual length of packet */ uint32_t include_len; /* data captured in file */ uint32_t rec_len; /* total length of record, including padding */ uint32_t cum_drops; /* cumulative number of droped packets */ uint32_t time_sec; /* timestamp seconds */ uint32_t time_usec; /* timestamp microseconds */ }; /* sunscreen record header */ struct sunscreenrec_hdr { uint32_t marker; /* magic num record header */ uint16_t type; /* record type */ uint16_t length; /* total record length */ uint32_t sequence; /* sequencee number */ uint32_t flags; /* flags */ uint32_t time_sec; /* time seconds */ uint32_t time_usec; /* time microseconds */ }; struct screen_packet { uint32_t pktlen; uint32_t savelen; uint32_t time_sec; uint32_t time_usec; char intfc[16]; uint32_t mac_type; uint32_t mac_length; uint32_t why; }; struct screen_tcp_session { struct in_addr ip_src; struct in_addr ip_dst; uint16_t srcport; uint16_t dstport; uint32_t session_id; uint32_t bytes_fwd; uint32_t bytes_rev; uint32_t pkts_fwd; uint32_t pkts_rev; uint32_t time_start; uint32_t time_last; uint32_t state; }; struct screen_udp_session { struct in_addr ip_src; struct in_addr ip_dst; uint16_t srcport; uint16_t dstport; uint32_t session_id; uint32_t bytes_fwd; uint32_t bytes_rev; uint32_t pkts_fwd; uint32_t pkts_rev; uint32_t time_start; uint32_t time_last; }; struct screen_ip_session { struct in_addr ip_src; struct in_addr ip_dst; uint32_t protocol; uint32_t session_id; uint32_t bytes_fwd; uint32_t bytes_rev; uint32_t pkts_fwd; uint32_t pkts_rev; uint32_t time_start; uint32_t time_last; }; struct screen_xtnd { struct in_addr ip_src; struct in_addr ip_dst; uint16_t srcport; uint16_t dstport; uint32_t session_id; u_char ip_proto; u_char level; u_char prio; u_char xflgs; u_char res[12]; char appname[32]; }; static const char * const screen_error_table[] = { "deny rule or no pass rule", "no connection", "out of memory", "too many conns", "invalid port", "bad format", "bad direction", "too many rsps", "too short", "bad protocol", "no port map", "bad port map", "bad NIS proto", "bad interface", "bad policy", "bad identity", "bad source addr", "stale policy", "frag too big", "illegal frag overlap", "src cert not in group", "cert not in rule", "attempt to encrypt a decrypted packet", "no state associated with policy", "stale skip policy", };