diff --git a/nping/ProbeMode.cc b/nping/ProbeMode.cc index b85c6d7f4..407019f60 100644 --- a/nping/ProbeMode.cc +++ b/nping/ProbeMode.cc @@ -1,4 +1,3 @@ - /*************************************************************************** * ProbeMode.cc -- Probe Mode is nping's default working mode. Basically, * * it involves sending the packets that the user requested at regular * @@ -157,7 +156,7 @@ int ProbeMode::start(){ u16 *targetPorts=NULL; /**< Pointer to array of target ports */ int numTargetPorts=0; /**< Total number of target ports */ u16 currentPort=0; /**< Current target port */ - char *filterstring; /**< Stores BFP filter spec string */ + const char *filterstring; /**< Stores BFP filter spec string */ int rawipsd=-1; /**< Descriptor for raw IP socket */ enum nsock_loopstatus loopret; /**< Stores nsock_loop returned status */ nsock_iod pcap_nsi; /**< Stores Pcap IOD */ @@ -1237,7 +1236,6 @@ int ProbeMode::fillPacketARP(NpingTarget *target, u8 *buff, int bufflen, int *fi } - /** This function creates a BPF filter specification, suitable to be passed to * pcap_compile() or nsock_pcap_open(). It reads info from "NpingOps o" and * creates the right BPF filter for the current operation mode. However, if @@ -1247,7 +1245,7 @@ int ProbeMode::fillPacketARP(NpingTarget *target, u8 *buff, int bufflen, int *fi * is done here already. * @warning Returned pointer is a statically allocated buffer that subsequent * calls will overwrite. */ -char *ProbeMode::getBPFFilterString(){ +const char *ProbeMode::getBPFFilterString(){ char ipstring[128]; static char filterstring[1024]; diff --git a/nping/ProbeMode.h b/nping/ProbeMode.h index 54398954c..f4095e5c8 100644 --- a/nping/ProbeMode.h +++ b/nping/ProbeMode.h @@ -116,7 +116,7 @@ class ProbeMode { static int fillPacketUDP(NpingTarget *target, u16 port, u8 *buff, int bufflen, int *filledlen, int rawfd); static int fillPacketICMP(NpingTarget *target, u8 *buff, int bufflen, int *filledlen, int rawfd); static int fillPacketARP(NpingTarget *target, u8 *buff, int bufflen, int *filledlen, int rawfd); - static char *getBPFFilterString(); + static const char *getBPFFilterString(); static void probe_nping_event_handler(nsock_pool nsp, nsock_event nse, void *arg); static void probe_delayed_output_handler(nsock_pool nsp, nsock_event nse, void *mydata); static void probe_tcpconnect_event_handler(nsock_pool nsp, nsock_event nse, void *arg);