Put getting local/remote address behinf net_if

PUBLISHED_FROM=f88056e79b632d9eee288dacf61c2f87ff3ceca5
This commit is contained in:
Deomid Ryabkov authored and Sergey Lyubka committed 2015-11-30 12:27:58 +00:00
1 parent 6c77351c58
commit 7951dac9d5
2 files changed
+79 -45

No files matched your search

+10 -2
View File
@@ -1117,6 +1117,10 @@ void mg_if_destroy_conn(struct mg_connection *nc);
void mg_close_conn(struct mg_connection *nc);
/* Put connection's address into *sa, local (remote = 0) or remote. */
void mg_if_get_conn_addr(struct mg_connection *nc, int remote,
union socket_address *sa);
#endif /* MG_NET_IF_HEADER_INCLUDED */
/*
* Copyright (c) 2014 Cesanta Software Limited
@@ -1242,7 +1246,7 @@ void mg_set_close_on_exec(sock_t);
#define MG_SOCK_STRINGIFY_PORT 2
#define MG_SOCK_STRINGIFY_REMOTE 4
/*
* Convert socket's local or remote address into string.
* Convert connection's local or remote address into string.
*
* The `flags` parameter is a bit mask that controls the behavior,
* see `MG_SOCK_STRINGIFY_*` definitions.
@@ -1254,7 +1258,11 @@ void mg_set_close_on_exec(sock_t);
* If both port number and IP address are printed, they are separated by `:`.
* If compiled with `-DMG_ENABLE_IPV6`, IPv6 addresses are supported.
*/
void mg_conn_addr_to_str(struct mg_connection *nc, char *buf, size_t len,
int flags);
#ifndef MG_DISABLE_SOCKET_IF /* Legacy interface. */
void mg_sock_to_str(sock_t sock, char *buf, size_t len, int flags);
#endif
/*
* Convert socket's address into string.
@@ -1282,7 +1290,7 @@ int mg_hexdump(const void *buf, int len, char *dst, int dst_len);
* event handler.
*/
void mg_hexdump_connection(struct mg_connection *nc, const char *path,
int num_bytes, int ev);
const void *buf, int num_bytes, int ev);
/*
* Print message to buffer. If buffer is large enough to hold the message,
* return buffer. If buffer is to small, allocate large enough buffer on heap,