Commit 7d188078 authored by Robert David Graham's avatar Robert David Graham
Browse files

fix

parent 09ff041a
Loading
Loading
Loading
Loading
+23 −7
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ uint64_t foo_timestamp = 0;
uint64_t foo_count = 0;

/***************************************************************************
 * Parameters we send to each thread-PAIR. Threads come in pairs, a
 * transmit and receive thread, that share the same configuration.
 * We create a pair of transnit/receive threads for each network adapter.
 * This structure contains the parameters we send to each pair.
 ***************************************************************************/
struct ThreadPair {
    /** This points to the central configuration. Note that it's 'const',
@@ -82,30 +82,43 @@ struct ThreadPair {
     * unsafe */
    const struct Masscan *masscan;

    /** The adapter used by the threads. Normally, thread-pairs have
    /** The adapter used by the thread-pair. Normally, thread-pairs have
     * their own network adapter, especially when doing PF_RING
     * clustering. */
    struct Adapter *adapter;

    /**
     * The thread-pair use a "packet_buffer" and "transmit_queue" to 
     * send packets to each other */
     * send packets to each other. That's because when doing things
	 * like banner-checking, the receive-thread needs to respond to
	 * things like syn-acks received from the target. However, the
	 * receive-thread cannot transmit packets, so it uses this ring
	 * in order to send the packets to the transmit thread for
	 * transmission.
	 */
    PACKET_QUEUE *packet_buffers;
    PACKET_QUEUE *transmit_queue;

    /**
     * The index of the network adapter that we are using for this
     * thread-pair
     * thread-pair. This is an index into the "masscan->nic[]"
	 * array.
     */
    unsigned nic_index;

    /**
     * This is an optimized binary-search when looking up IP addresses
     * based on the index.
     * based on the index. When scanning the entire Internet, the target
	 * list is broken into thousands of subranges as we exclude certain
	 * ranges. Doing a lookup for each IP address is slow, so this 'picker'
	 * system speeds it up.
     */
    unsigned *picker;

    /* the master 'i' variable */
    /**
	 * A copy of the master 'index' variable. This is just advisory for
	 * other threads, to tell them how far we've gotten.
	 */
    uint64_t my_index;


@@ -113,6 +126,9 @@ struct ThreadPair {
     * formatting packets */
    struct TemplateSet tmplset[1];

	/**
	 * The current IP address we are using for transmit/receive.
	 */
    unsigned adapter_ip;
    unsigned adapter_port;
    unsigned char adapter_mac[6];
+1 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ blackrock_unshuffle(const struct BlackRock *br, uint64_t m)


/***************************************************************************
 * This function called only during selftest/regression-test.
 ***************************************************************************/
static unsigned
blackrock_verify(struct BlackRock *br, uint64_t max)
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <IntDir>$(SolutionDir)\..\tmp\$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)\..\bin</OutDir>
    <OutDir>$(SolutionDir)\..\bin\</OutDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LinkIncremental>true</LinkIncremental>