| 1 | /*
|
|---|
| 2 | * Copyright (c) 2014 Martin Decky
|
|---|
| 3 | * All rights reserved.
|
|---|
| 4 | *
|
|---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 6 | * modification, are permitted provided that the following conditions
|
|---|
| 7 | * are met:
|
|---|
| 8 | *
|
|---|
| 9 | * - Redistributions of source code must retain the above copyright
|
|---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 13 | * documentation and/or other materials provided with the distribution.
|
|---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 15 | * derived from this software without specific prior written permission.
|
|---|
| 16 | *
|
|---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | /** @addtogroup genericipc
|
|---|
| 30 | * @{
|
|---|
| 31 | */
|
|---|
| 32 | /**
|
|---|
| 33 | * @file interface.h
|
|---|
| 34 | * @brief List of all known interfaces and their codes.
|
|---|
| 35 | */
|
|---|
| 36 |
|
|---|
| 37 | #ifndef ABI_IPC_INTERFACES_H_
|
|---|
| 38 | #define ABI_IPC_INTERFACES_H_
|
|---|
| 39 |
|
|---|
| 40 | #include <abi/fourcc.h>
|
|---|
| 41 |
|
|---|
| 42 | #define IFACE_EXCHANGE_MASK 0x03
|
|---|
| 43 | #define IFACE_MOD_MASK 0x04
|
|---|
| 44 |
|
|---|
| 45 | /** Interface exchange management style
|
|---|
| 46 | *
|
|---|
| 47 | */
|
|---|
| 48 | typedef enum {
|
|---|
| 49 | /** No explicit exchange management
|
|---|
| 50 | *
|
|---|
| 51 | * Suitable for protocols which use a single
|
|---|
| 52 | * IPC message per exchange only.
|
|---|
| 53 | */
|
|---|
| 54 | IFACE_EXCHANGE_ATOMIC = 0x00,
|
|---|
| 55 |
|
|---|
| 56 | /** Exchange management via mutual exclusion
|
|---|
| 57 | *
|
|---|
| 58 | * Suitable for any kind of client/server
|
|---|
| 59 | * communication, but with possibly limited
|
|---|
| 60 | * parallelism.
|
|---|
| 61 | */
|
|---|
| 62 | IFACE_EXCHANGE_SERIALIZE = 0x01,
|
|---|
| 63 |
|
|---|
| 64 | /** Exchange management via connection cloning
|
|---|
| 65 | *
|
|---|
| 66 | * Suitable for servers which support client
|
|---|
| 67 | * connection tracking and connection cloning.
|
|---|
| 68 | */
|
|---|
| 69 | IFACE_EXCHANGE_PARALLEL = 0x02
|
|---|
| 70 | } iface_exch_mgmt_t;
|
|---|
| 71 |
|
|---|
| 72 | /** Interface modifiers
|
|---|
| 73 | *
|
|---|
| 74 | */
|
|---|
| 75 | typedef enum {
|
|---|
| 76 | IFACE_MOD_NONE = 0x00,
|
|---|
| 77 | IFACE_MOD_CALLBACK = 0x04
|
|---|
| 78 | } iface_mod_t;
|
|---|
| 79 |
|
|---|
| 80 | typedef enum {
|
|---|
| 81 | INTERFACE_LOADER =
|
|---|
| 82 | FOURCC_COMPACT('l', 'o', 'a', 'd') | IFACE_EXCHANGE_PARALLEL,
|
|---|
| 83 | INTERFACE_DDF_CLIENT =
|
|---|
| 84 | FOURCC_COMPACT('d', 'd', 'f', 'c') | IFACE_EXCHANGE_SERIALIZE,
|
|---|
| 85 | INTERFACE_TCP_CB =
|
|---|
| 86 | FOURCC_COMPACT('t', 'c', 'p', ' ') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK,
|
|---|
| 87 | INTERFACE_UDP_CB =
|
|---|
| 88 | FOURCC_COMPACT('u', 'd', 'p', ' ') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK
|
|---|
| 89 | } iface_t;
|
|---|
| 90 |
|
|---|
| 91 | #endif
|
|---|
| 92 |
|
|---|
| 93 | /** @}
|
|---|
| 94 | */
|
|---|