1/* 2 * Copyright (c) 2014, University of Washington. 3 * All rights reserved. 4 * 5 * This file is distributed under the terms in the attached LICENSE file. 6 * If you do not find this file, copies can be found by writing to: 7 * ETH Zurich D-INFK, CAB F.78, Universitaetstrasse 6, CH-8092 Zurich. 8 * Attn: Systems Group. 9 */ 10 11#ifndef ARRAKIS_ARRANET_H 12#define ARRAKIS_ARRANET_H 13 14struct packet { 15 struct packet *next; 16 uint8_t *payload; 17 lpaddr_t pa; 18 size_t len; 19 uint64_t flags; 20 struct socket *sock; 21 void *opaque; 22}; 23 24typedef void (*arranet_tx_done_fn)(void *opaque); 25 26int recvfrom_arranet(int sockfd, void **buf, struct packet **p, 27 struct sockaddr *src_addr, socklen_t *addrlen); 28void arranet_recv_free(struct packet *p); 29int sendmsg_arranet(int sockfd, const struct msghdr *msg); 30void arranet_register_tx_done_callback(arranet_tx_done_fn callback); 31 32#define SENDMSG_WITH_COPY 33 34#endif 35