X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/5025a9931265fe959126155737a04ec8f8f686aa..cf9905debc2889e645ddc09658693a60553f081b:/network.h diff --git a/network.h b/network.h index af83e653..45f4e2a7 100644 --- a/network.h +++ b/network.h @@ -15,7 +15,7 @@ #ifndef DONE_TYPEDEFS #define DONE_TYPEDEFS -typedef struct config_tag Config; +typedef struct conf_tag Conf; typedef struct backend_tag Backend; typedef struct terminal_tag Terminal; #endif @@ -37,6 +37,7 @@ struct socket_function_table { void (*close) (Socket s); int (*write) (Socket s, const char *data, int len); int (*write_oob) (Socket s, const char *data, int len); + void (*write_eof) (Socket s); void (*flush) (Socket s); void (*set_private_ptr) (Socket s, void *ptr); void *(*get_private_ptr) (Socket s); @@ -94,18 +95,18 @@ struct plug_function_table { Socket new_connection(SockAddr addr, char *hostname, int port, int privport, int oobinline, int nodelay, int keepalive, - Plug plug, const Config *cfg); + Plug plug, Conf *conf); Socket new_listener(char *srcaddr, int port, Plug plug, int local_host_only, - const Config *cfg, int addressfamily); + Conf *conf, int addressfamily); SockAddr name_lookup(char *host, int port, char **canonicalname, - const Config *cfg, int addressfamily); + Conf *conf, int addressfamily); /* platform-dependent callback from new_connection() */ /* (same caveat about addr as new_connection()) */ Socket platform_new_connection(SockAddr addr, char *hostname, int port, int privport, int oobinline, int nodelay, int keepalive, - Plug plug, const Config *cfg); + Plug plug, Conf *conf); /* socket functions */ @@ -140,6 +141,7 @@ Socket sk_register(OSSocket sock, Plug plug); #define sk_close(s) (((*s)->close) (s)) #define sk_write(s,buf,len) (((*s)->write) (s, buf, len)) #define sk_write_oob(s,buf,len) (((*s)->write_oob) (s, buf, len)) +#define sk_write_eof(s) (((*s)->write_eof) (s)) #define sk_flush(s) (((*s)->flush) (s)) #ifdef DEFINE_PLUG_METHOD_MACROS @@ -202,6 +204,12 @@ void net_pending_errors(void); */ int net_service_lookup(char *service); +/* + * Look up the local hostname; return value needs freeing. + * May return NULL. + */ +char *get_hostname(void); + /********** SSL stuff **********/ /*