forked from robertdavidgraham/masscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19cc149
commit ab952a7
Showing
12 changed files
with
368 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
#ifndef PROTO_INTERACTIVE_H | ||
#define PROTO_INTERACTIVE_H | ||
#include <stdio.h> | ||
#include "util-bool.h" /* <stdbool.h> */ | ||
|
||
enum TCP__flags { | ||
TCP__static,/* it's static data, so the send function can point to it */ | ||
TCP__copy, /* the send function must copy the data */ | ||
TCP__adopt /* the buffer was just allocated, so the send function can adopt the pointer */ | ||
}; | ||
|
||
struct InteractiveData { | ||
const void *m_payload; | ||
unsigned m_length; | ||
unsigned is_payload_dynamic:1; | ||
void *tcpcon; | ||
void *tcb; | ||
void (*send)(void *tcpcon, void *tcb, const void *buf, size_t length, enum TCP__flags flags, bool is_fin, unsigned secs, unsigned usecs); | ||
unsigned secs; | ||
unsigned usecs; | ||
unsigned is_closing:1; | ||
}; | ||
enum { | ||
TCPTRAN_DYNAMIC = 0x0001, | ||
}; | ||
|
||
/** | ||
* Called to 'transmit' TCP packet payload. | ||
*/ | ||
void | ||
tcp_transmit(struct InteractiveData *more, const void *data, size_t length, unsigned flags); | ||
tcp_transmit(struct InteractiveData *more, const void *data, size_t length, enum TCP__flags flags); | ||
|
||
/** | ||
* Called to close the connection | ||
*/ | ||
void | ||
tcp_close(struct InteractiveData *more); | ||
|
||
/** | ||
* Called to allocate a TCP buffer. | ||
*/ | ||
unsigned char * | ||
tcp_transmit_alloc(struct InteractiveData *more, size_t length); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.