123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /* Copyright (C) 2016 Max Riechelmann <max.riechelmann@student.kit.edu>
- (Karlsruhe Institute of Technology)
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by the
- Free Software Foundation; either version 2.1 of the License, or (at your
- option) any later version.
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- details.
- You should have received a copy of the GNU Lesser General Public License along
- with this library; if not, write to the Free Software Foundation, Inc., 51
- Franklin St, Fifth Floor, Boston, MA 02110, USA
- */
- /**
- * SECTION: myco-agent
- * @Short_description: agent library
- * @Title: MycoAgent
- *
- * MycoAgent implements the agent side of the Mycorrhiza distributed system.
- * It (un-)registers with the mycoagent and provides information about
- * accessible data RESOURCES.
- */
- #ifndef __MYCO_AGENT_H
- #define __MYCO_AGENT_H
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- /**
- * myco_agent_register:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- *
- * Registers self with the local daemon process.
- *
- * Returns: 0 on success, -1 on error
- */
- int myco_agent_register (int pid, const char *myco_daemon_address, uint16_t myco_daemon_port);
- /**
- * myco_agent_unregister:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- *
- * Unregisters self with the local daemon process.
- *
- * Returns: 0 on success, -1 on error
- */
- int myco_agent_unregister (int pid, const char *myco_daemon_address, uint16_t myco_daemon_port);
- /**
- * myco_agent_register_resource:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- * @resource_name: Name of resource.
- *
- * Registers self with the local daemon process.
- *
- * Returns: -1 on error, the unique resource id on success
- */
- int myco_agent_register_resource (int pid, const char *myco_daemon_address, uint16_t myco_daemon_port, const char *resource_name);
- /**
- * myco_agent_request_resource:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- * @resource_id: The unique resource id.
- * @resource_pointer: Pointer to the local memory region where to write the resource to.
- * @resource_size: Size in Bytes the resource takes.
- * @resource_name: Variable for resource name, filled by daemon.
- *
- * Requests a resource from the daemon. If size equals actual resource size transfer is
- * done immediatly. This only works if resource size is known beforehand. If resource
- * size is unknown check with myco_agent_request_resource_info();
- *
- * Returns: -1 on error, 0 on success
- */
- int myco_agent_request_resource(int pid, const char *myco_daemon_address, uint16_t myco_daemon_port, int resource_id, void *resource_pointer, int resource_size, char *resource_name);
- /**
- * myco_agent_request_resource_info:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- * @resource_id: The unique resource id.
- * @resource_size: Size in Bytes the resource takes.
- * @resource_name: Variable for resource name, filled by daemon.
- *
- * Requests resource information from the daemon.
- *
- * Returns: -1 on error, 0 on success
- */
- int myco_agent_request_resource_info(int pid, const char *myco_daemon_address, uint16_t myco_daemon_port, int resource_id, int resource_size, char *resource_name);
- /**
- * myco_agent_request_resource_list:
- * @pid: The PID of the user program.
- * @myco_daemon_address: The IP address of the daemon (usually localhost).
- * @myco_daemon_port: The port of the daemon.
- * @resource_list: A comma seperated list of resources (id, name, size).
- *
- * Requests resource list. Obtains a list of all resources in the current network.
- *
- * Returns: -1 on error, 0 on success
- */
- int myco_agent_request_resource_list(int pid, const char *myco_daemon_address, uint16_t myco_daemon_port, char *resource_list);
- #endif //__MYCO_AGENT_H
|