Jens Wiklander | 02389a9 | 2016-12-16 11:13:38 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2016, Linaro Limited |
| 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 are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| 9 | * this list of conditions and the following disclaimer. |
| 10 | * |
| 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | * this list of conditions and the following disclaimer in the documentation |
| 13 | * and/or other materials provided with the distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 25 | * POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | #ifndef __TA_SOCKET_H |
| 29 | #define __TA_SOCKET_H |
| 30 | |
| 31 | #define TA_SOCKET_UUID { 0x873bcd08, 0xc2c3, 0x11e6, { \ |
| 32 | 0xa9, 0x37, 0xd0, 0xbf, 0x9c, 0x45, 0xc6, 0x1c } } |
| 33 | |
| 34 | /* |
| 35 | * Opens a TCP socket and returns an opaque handle |
| 36 | * |
| 37 | * [in] params[0].value.a ipVersion |
| 38 | * [in] params[0].value.b server port |
| 39 | * [in] params[1].memref server address |
| 40 | * [out] params[2].memref handle |
| 41 | * [out] params[3].value.a protocol error |
| 42 | */ |
| 43 | #define TA_SOCKET_CMD_TCP_OPEN 0 |
| 44 | |
| 45 | /* |
| 46 | * Opens a UDP socket and returns an opaque handle |
| 47 | * |
| 48 | * [in] params[0].value.a ipVersion |
| 49 | * [in] params[0].value.b server port |
| 50 | * [in] params[1].memref server address |
| 51 | * [out] params[2].memref handle |
| 52 | * [out] params[3].value.a protocol error |
| 53 | */ |
| 54 | #define TA_SOCKET_CMD_UDP_OPEN 1 |
| 55 | |
| 56 | /* |
| 57 | * Closes a socket |
| 58 | * |
| 59 | * [in] params[0].memref handle |
| 60 | */ |
| 61 | #define TA_SOCKET_CMD_CLOSE 2 |
| 62 | |
| 63 | /* |
| 64 | * Send data on socket |
| 65 | * |
| 66 | * [in] params[0].memref handle |
| 67 | * [in] params[1].memref data |
| 68 | * [in] params[2].value.a timeout |
| 69 | * [out] params[2].value.b sent bytes |
| 70 | */ |
| 71 | #define TA_SOCKET_CMD_SEND 3 |
| 72 | |
| 73 | /* |
| 74 | * Receive data on socket |
| 75 | * |
| 76 | * [in] params[0].memref handle |
| 77 | * [out] params[1].memref data |
| 78 | * [in] params[2].value.a timeout |
| 79 | */ |
| 80 | #define TA_SOCKET_CMD_RECV 4 |
| 81 | |
| 82 | /* |
| 83 | * Retrieve protocol error from socket |
| 84 | * |
| 85 | * [in] params[0].memref handle |
| 86 | * [out] params[1].value.a error code |
| 87 | */ |
| 88 | #define TA_SOCKET_CMD_ERROR 5 |
| 89 | |
| 90 | /* |
| 91 | * Ioctl on socket |
| 92 | * |
| 93 | * [in] params[0].memref handle |
| 94 | * [in/out] params[1].memref data |
| 95 | * [in] params[2].value.a command code |
| 96 | */ |
| 97 | #define TA_SOCKET_CMD_IOCTL 6 |
| 98 | |
| 99 | #endif /*__TA_SOCKET_H*/ |