1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 19:59:02 +00:00

Move some prototypes to nsock_internal.h

This commit is contained in:
dmiller
2024-11-13 19:15:10 +00:00
parent 82586d6327
commit 3f64103cf0
15 changed files with 17 additions and 97 deletions

View File

@@ -104,21 +104,6 @@ struct io_engine engine_epoll = {
/* --- INTERNAL PROTOTYPES --- */ /* --- INTERNAL PROTOTYPES --- */
static void iterate_through_event_lists(struct npool *nsp, int evcount); static void iterate_through_event_lists(struct npool *nsp, int evcount);
/* defined in nsock_core.c */
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
void iterate_through_pcap_events(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
extern struct timeval nsock_tod;
/* /*
* Engine specific data structure * Engine specific data structure

View File

@@ -172,20 +172,6 @@ static void force_operation(struct npool *nsp, struct nevent *nse);
static void free_eov(struct npool *nsp, struct extended_overlapped *eov); static void free_eov(struct npool *nsp, struct extended_overlapped *eov);
static int map_faulty_errors(int err); static int map_faulty_errors(int err);
/* defined in nsock_core.c */
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
void iterate_through_pcap_events(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
extern struct timeval nsock_tod;
int iocp_init(struct npool *nsp) { int iocp_init(struct npool *nsp) {
struct iocp_engine_info *iinfo; struct iocp_engine_info *iinfo;

View File

@@ -97,21 +97,6 @@ struct io_engine engine_kqueue = {
/* --- INTERNAL PROTOTYPES --- */ /* --- INTERNAL PROTOTYPES --- */
static void iterate_through_event_lists(struct npool *nsp, int evcount); static void iterate_through_event_lists(struct npool *nsp, int evcount);
/* defined in nsock_core.c */
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
void iterate_through_pcap_events(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
extern struct timeval nsock_tod;
/* /*
* Engine specific data structure * Engine specific data structure

View File

@@ -129,21 +129,6 @@ struct io_engine engine_poll = {
/* --- INTERNAL PROTOTYPES --- */ /* --- INTERNAL PROTOTYPES --- */
static void iterate_through_event_lists(struct npool *nsp); static void iterate_through_event_lists(struct npool *nsp);
/* defined in nsock_core.c */
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
void iterate_through_pcap_events(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
extern struct timeval nsock_tod;
/* /*
* Engine specific data structure * Engine specific data structure

View File

@@ -91,21 +91,6 @@ struct io_engine engine_select = {
/* --- INTERNAL PROTOTYPES --- */ /* --- INTERNAL PROTOTYPES --- */
static void iterate_through_event_lists(struct npool *nsp); static void iterate_through_event_lists(struct npool *nsp);
/* defined in nsock_core.c */
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
extern struct timeval nsock_tod;
/* /*
* Engine specific data structure * Engine specific data structure

View File

@@ -87,11 +87,6 @@
* this */ * this */
struct timeval nsock_tod; struct timeval nsock_tod;
/* Internal function defined in nsock_event.c
* Update the nse->iod first events, assuming nse is about to be deleted */
void update_first_events(struct nevent *nse);
/* Each iod has a count of pending socket reads, socket writes, and pcap reads. /* Each iod has a count of pending socket reads, socket writes, and pcap reads.
* When a descriptor's count is nonzero, its bit must be set in the appropriate * When a descriptor's count is nonzero, its bit must be set in the appropriate

View File

@@ -64,8 +64,6 @@
#include <string.h> #include <string.h>
extern struct timeval nsock_tod;
/* Find the type of an event that spawned a callback */ /* Find the type of an event that spawned a callback */
enum nse_type nse_type(nsock_event nse) { enum nse_type nse_type(nsock_event nse) {
struct nevent *me = (struct nevent *)nse; struct nevent *me = (struct nevent *)nse;

View File

@@ -133,6 +133,8 @@ enum iod_state {
/* ------------------- STRUCTURES ------------------- */ /* ------------------- STRUCTURES ------------------- */
extern struct timeval nsock_tod;
struct readinfo { struct readinfo {
enum nsock_read_types read_type; enum nsock_read_types read_type;
/* num lines; num bytes; whatever (depends on read_type) */ /* num lines; num bytes; whatever (depends on read_type) */
@@ -521,5 +523,20 @@ static inline struct nevent *lnode_nevent2(gh_lnode_t *lnode) {
return container_of(lnode, struct nevent, nodeq_pcap); return container_of(lnode, struct nevent, nodeq_pcap);
} }
/* defined in nsock_core.c */
void process_iod_events(struct npool *nsp, struct niod *nsi, int ev);
void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int ev);
void process_expired_events(struct npool *nsp);
#if HAVE_PCAP
int pcap_read_on_nonselect(struct npool *nsp);
void iterate_through_pcap_events(struct npool *nsp);
#endif
/* defined in nsock_event.c */
void update_first_events(struct nevent *nse);
/* defined in nsock_engines.c */
struct io_engine *get_io_engine(void);
#endif /* NSOCK_INTERNAL_H */ #endif /* NSOCK_INTERNAL_H */

View File

@@ -64,8 +64,6 @@
static void nsock_stderr_logger(const struct nsock_log_rec *rec); static void nsock_stderr_logger(const struct nsock_log_rec *rec);
extern struct timeval nsock_tod;
nsock_loglevel_t NsockLogLevel = NSOCK_LOG_ERROR; nsock_loglevel_t NsockLogLevel = NSOCK_LOG_ERROR;
nsock_logger_t NsockLogger = nsock_stderr_logger; nsock_logger_t NsockLogger = nsock_stderr_logger;

View File

@@ -73,8 +73,6 @@
#include "nsock_pcap.h" #include "nsock_pcap.h"
extern struct timeval nsock_tod;
#if HAVE_PCAP #if HAVE_PCAP
#ifndef PCAP_NETMASK_UNKNOWN #ifndef PCAP_NETMASK_UNKNOWN

View File

@@ -71,16 +71,11 @@
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
extern struct timeval nsock_tod;
/* To use this library, the first thing they must do is create a pool /* To use this library, the first thing they must do is create a pool
* so we do the initialization during the first pool creation */ * so we do the initialization during the first pool creation */
static int nsocklib_initialized = 0; static int nsocklib_initialized = 0;
/* defined in nsock_engines.h */
struct io_engine *get_io_engine(void);
/* ---- INTERNAL FUNCTIONS PROTOTYPES ---- */ /* ---- INTERNAL FUNCTIONS PROTOTYPES ---- */
static void nsock_library_initialize(void); static void nsock_library_initialize(void);
/* --------------------------------------- */ /* --------------------------------------- */

View File

@@ -78,7 +78,6 @@
* (bri@ifokr.org) tests on an Pentium 686 against the ciphers listed. */ * (bri@ifokr.org) tests on an Pentium 686 against the ciphers listed. */
#define CIPHERS_FAST "RC4-SHA:RC4-MD5:NULL-SHA:EXP-DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-RC4-MD5:NULL-MD5:EDH-RSA-DES-CBC-SHA:EXP-RC2-CBC-MD5:EDH-RSA-DES-CBC3-SHA:EXP-ADH-RC4-MD5:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:EXP-ADH-DES-CBC-SHA:ADH-AES256-SHA:ADH-DES-CBC-SHA:ADH-RC4-MD5:AES256-SHA:DES-CBC-SHA:DES-CBC3-SHA:ADH-DES-CBC3-SHA:AES128-SHA:ADH-AES128-SHA:eNULL:ALL" #define CIPHERS_FAST "RC4-SHA:RC4-MD5:NULL-SHA:EXP-DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-RC4-MD5:NULL-MD5:EDH-RSA-DES-CBC-SHA:EXP-RC2-CBC-MD5:EDH-RSA-DES-CBC3-SHA:EXP-ADH-RC4-MD5:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:EXP-ADH-DES-CBC-SHA:ADH-AES256-SHA:ADH-DES-CBC-SHA:ADH-RC4-MD5:AES256-SHA:DES-CBC-SHA:DES-CBC3-SHA:ADH-DES-CBC3-SHA:AES128-SHA:ADH-AES128-SHA:eNULL:ALL"
extern struct timeval nsock_tod;
#define NSOCK_SSL_STATE_UNINITIALIZED -1 #define NSOCK_SSL_STATE_UNINITIALIZED -1
#define NSOCK_SSL_STATE_INITIALIZED 1 #define NSOCK_SSL_STATE_INITIALIZED 1
#define NSOCK_SSL_STATE_ATEXIT 0 #define NSOCK_SSL_STATE_ATEXIT 0

View File

@@ -54,8 +54,6 @@
#include "nsock_internal.h" #include "nsock_internal.h"
#include "nsock_log.h" #include "nsock_log.h"
extern struct timeval nsock_tod;
/* Send back an NSE_TYPE_TIMER after the number of milliseconds specified. Of /* Send back an NSE_TYPE_TIMER after the number of milliseconds specified. Of
* course it can also return due to error, cancellation, etc. */ * course it can also return due to error, cancellation, etc. */
nsock_event_id nsock_timer_create(nsock_pool ms_pool, nsock_ev_handler handler, nsock_event_id nsock_timer_create(nsock_pool ms_pool, nsock_ev_handler handler,

View File

@@ -60,8 +60,6 @@
#define DEFAULT_PROXY_PORT_HTTP 8080 #define DEFAULT_PROXY_PORT_HTTP 8080
extern struct timeval nsock_tod;
extern const struct proxy_spec ProxySpecHttp; extern const struct proxy_spec ProxySpecHttp;

View File

@@ -61,8 +61,6 @@
#define DEFAULT_PROXY_PORT_SOCKS4 1080 #define DEFAULT_PROXY_PORT_SOCKS4 1080
extern struct timeval nsock_tod;
extern const struct proxy_spec ProxySpecSocks4; extern const struct proxy_spec ProxySpecSocks4;