?? sdm_utils.h
字號:
//--------------------------------------------------------------------//----- $Header: /home/cvsroot/sebek/mon/sdm_utils.h,v 1.3 2002/09/08 22:48:57 cvs Exp $//--------------------------------------------------------------------/* * Copyright (C) 2001/2002 The Honeynet Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by The Honeynet Project. * 4. The name "The Honeynet Project" may not be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *///---- ips seem to be working other than net and bcast//---- need to check ports.#ifndef sbm_utils_h#define sbm_utils_h 1#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <unistd.h>#include <sys/types.h>#include <netinet/in.h>#include <sys/ioctl.h>#include <sys/socket.h>#include <net/if.h>#include <libnet.h>#include <time.h>#include <openssl/blowfish.h>#include <openssl/md5.h>#define IBUF 1024 //----- buffer length without ID#define MAX_DECOY 10 //----- MAX number of decoys to send in a sequence.#define MAX_INTERPKTDELAY 10000000 //----- MAX interpacket delay in usec//----- shameless mimic of snort here...typedef struct _progvars{ int verbose; u_int32_t dst_ip; u_int32_t src_ip; u_int32_t dst_mask; u_int32_t src_mask; u_int16_t dst_port; u_int16_t src_port; u_int16_t magic; BF_KEY key; char filename[IBUF]; u_int32_t ipd;} PV;//------------------------------------------------------------------------------//----- GLOBALS//------------------------------------------------------------------------------extern PV pv;extern const char * filename;extern const u_int32_t netmasks[33];//------------------------------------------------------------------------------//----- get_id: gets the first nonloopback ip addr and returns it as a u_int32_t//----- "inspired" by code from freebsd and from stevens.//----- //----- ebalas@iu.edu 6/28/02//------------------------------------------------------------------------------u_int get_id();//------------------------------------------------------------------------------//----- open_socket: opens a raw socket return -1 on error//-------------------------------------------------------------------------------int open_socket();//-------------------------------------------------------------------------------//------ create_udp: creates upd packets used to export data //------------------------------------------------------------------------------void create_udp(const u_char *payload, int paysize, struct libnet_link_int *write2net, u_char *libnet_dev,int type);void FatalError(const char *format,...);#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -