123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- /* 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/ipc.h>
- #include <sys/msg.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <errno.h>
- #include <string.h>
- #include "myco-ipc.c"
- #include <stdlib.h>
- #include <sys/file.h>
- #include <sys/mman.h>
- #include <sys/wait.h>
- /**
- * myco_agent_register:
- *
- * Registers self.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- int myco_agent_register (const char *agent_name);
- /**
- * myco_agent_unregister:
- *
- * Unregisters self.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- int myco_agent_unregister (const char *agent_name, int message_queue_id);
- /**
- * myco_agent_register_resource:
- *
- * Registers a resource.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- void *myco_agent_register_resource (int agent_message_queue_id, const char *agent_name, const char *resource_name, int resource_transactional, pid_t pid, int size);
- /**
- * myco_agent_unregister_resource:
- *
- * Unregister a resource.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- int myco_agent_unregister_resource (int message_queue_id, const char *resource_name);
- /**
- * myco_agent_request_resource:
- *
- * Requests a resource.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- struct resource myco_agent_request_resource(int message_queue_id, char *resource_name);
- /**
- * myco_agent_request_resource_list:
- *
- * Requests resource list. Obtains a list of all resources in the current network.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- int myco_agent_request_resource_list(int message_queue_id);
- /**
- * myco_agent_write_remote_resource:
- *
- * Writes to a non-transactional resource.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- int myco_agent_write_remote_resource(int message_queue_id, char *resource_name);
- /**
- * myco_agent_read_remote_resource:
- *
- * Reads from a non-transactional resource.
- *
- * Returns: message_queue_id on success, -1 on error
- */
- struct resource myco_agent_read_remote_resource(int message_queue_id, char *resource_name);
- #endif //__MYCO_AGENT_H
|