summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2006-03-20 07:45:58 +0000
committerCarsten Haitzler <raster@rasterman.com>2006-03-20 07:45:58 +0000
commite8929d70439fce13304ce8be823bbb1faa378c5d (patch)
treea2f2fc13abf159d4773f5db815047e083cc36f76 /legacy/ecore/src/lib/ecore_ipc
parent4924cf8ba2065b70d40f0459508f94e2298398b6 (diff)
add calls to get ip addr of client or server (NULL for created servers of
course) and comments/docs SVN revision: 21437
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h4
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c72
2 files changed, 75 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
index 65bf3a7ab2..dc1088fa43 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -299,7 +299,8 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v);
299 EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients); 299 EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients);
300 EAPI void ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *srv, int size); 300 EAPI void ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *srv, int size);
301 EAPI int ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *srv); 301 EAPI int ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *srv);
302 302 EAPI char *ecore_ipc_server_ip_get(Ecore_Ipc_Server *svr);
303
303 /* FIXME: this needs to become an ipc message */ 304 /* FIXME: this needs to become an ipc message */
304 EAPI int ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size); 305 EAPI int ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size);
305 EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl); 306 EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl);
@@ -308,6 +309,7 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v);
308 EAPI void *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl); 309 EAPI void *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl);
309 EAPI void ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size); 310 EAPI void ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size);
310 EAPI int ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl); 311 EAPI int ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl);
312 EAPI char *ecore_ipc_client_ip_get(Ecore_Ipc_Client *cl);
311 313
312 EAPI int ecore_ipc_ssl_available_get(void); 314 EAPI int ecore_ipc_ssl_available_get(void);
313 /* FIXME: need to add a callback to "ok" large ipc messages greater than */ 315 /* FIXME: need to add a callback to "ok" large ipc messages greater than */
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index efedbecb01..d64b2c427d 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -612,6 +612,13 @@ ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char
612 ecore_con_server_client_limit_set(svr->server, client_limit, reject_excess_clients); 612 ecore_con_server_client_limit_set(svr->server, client_limit, reject_excess_clients);
613} 613}
614 614
615/**
616 * Sets the max data payload size for an Ipc message in bytes
617 *
618 * @param svr The given server.
619 * @param size The maximum data payload size in bytes.
620 * @ingroup Ecore_Ipc_Server_Group
621 */
615EAPI void 622EAPI void
616ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *svr, int size) 623ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *svr, int size)
617{ 624{
@@ -624,6 +631,13 @@ ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *svr, int size)
624 svr->max_buf_size = size; 631 svr->max_buf_size = size;
625} 632}
626 633
634/**
635 * Gets the max data payload size for an Ipc message in bytes
636 *
637 * @param svr The given server.
638 * @return The maximum data payload in bytes.
639 * @ingroup Ecore_Ipc_Server_Group
640 */
627EAPI int 641EAPI int
628ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *svr) 642ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *svr)
629{ 643{
@@ -636,6 +650,28 @@ ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *svr)
636 return svr->max_buf_size; 650 return svr->max_buf_size;
637} 651}
638 652
653/**
654 * Gets the IP address of a server that has been connected to.
655 *
656 * @param svr The given server.
657 * @return A pointer to an internal string that contains the IP address of
658 * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation.
659 * This string should not be modified or trusted to stay valid after
660 * deletion for the @p svr object. If no IP is known NULL is returned.
661 * @ingroup Ecore_Ipc_Server_Group
662 */
663EAPI char *
664ecore_ipc_server_ip_get(Ecore_Ipc_Server *svr)
665{
666 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
667 {
668 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER,
669 "ecore_con_server_ip_get");
670 return NULL;
671 }
672 return ecore_con_server_ip_get(svr->server);
673}
674
639 675
640#define CLENC(_member) \ 676#define CLENC(_member) \
641 d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \ 677 d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \
@@ -822,6 +858,13 @@ ecore_ipc_client_data_get(Ecore_Ipc_Client *cl)
822 return cl->data; 858 return cl->data;
823} 859}
824 860
861/**
862 * Sets the max data payload size for an Ipc message in bytes
863 *
864 * @param client The given client.
865 * @param size The maximum data payload size in bytes.
866 * @ingroup Ecore_Ipc_Client_Group
867 */
825EAPI void 868EAPI void
826ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size) 869ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size)
827{ 870{
@@ -834,6 +877,13 @@ ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size)
834 cl->max_buf_size = size; 877 cl->max_buf_size = size;
835} 878}
836 879
880/**
881 * Sets the max data payload size for an Ipc message in bytes
882 *
883 * @param cl The given client.
884 * @param size The maximum data payload size in bytes.
885 * @ingroup Ecore_Ipc_Client_Group
886 */
837EAPI int 887EAPI int
838ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl) 888ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl)
839{ 889{
@@ -847,6 +897,28 @@ ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl)
847} 897}
848 898
849/** 899/**
900 * Gets the IP address of a client that has been connected to.
901 *
902 * @param cl The given client.
903 * @return A pointer to an internal string that contains the IP address of
904 * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation.
905 * This string should not be modified or trusted to stay valid after
906 * deletion for the @p cl object. If no IP is known NULL is returned.
907 * @ingroup Ecore_Ipc_Client_Group
908 */
909EAPI char *
910ecore_ipc_client_ip_get(Ecore_Ipc_Client *cl)
911{
912 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT))
913 {
914 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT,
915 "ecore_con_client_ip_get");
916 return NULL;
917 }
918 return ecore_con_client_ip_get(cl->client);
919}
920
921/**
850 * Returns if SSL support is available 922 * Returns if SSL support is available
851 * @return 1 if SSL is available, 0 if it is not. 923 * @return 1 if SSL is available, 0 if it is not.
852 * @ingroup Ecore_Con_Client_Group 924 * @ingroup Ecore_Con_Client_Group