1/* 2 * Copyright (c) 2017 ETH Zurich. 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, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group. 8 */ 9#ifndef DEVIF_IP_H_ 10#define DEVIF_IP_H_ 1 11 12 13#include <barrelfish/barrelfish.h> 14 15#define UDP_PROT 0 16#define TCP_PROT 1 17 18 19struct ip_q; 20 21struct __attribute__((packed)) eth_addr { 22 uint8_t addr[6]; 23}; 24 25/** 26 * @param q ip queue to destroy 27 */ 28errval_t ip_destroy(struct ip_q* q); 29 30/** 31 * @brief initalized a queue that can send IP packets with a certain requirements. 32 * all other packets received on this queue will be dropped. 33 * 34 * @param q ip queue return value 35 * @param card_name the card name from which a hardware queue will be used 36 * to send IP packets. Internally a queue to the device with 37 * the card_name will be initalized 38 * @param qid the id of the hardware queue (used for filters) 39 * @param prot The protocol that is running on top of IP 40 * @param dst_ip Destination IP 41 * @param interrupt Interrupt handler 42 * @param poll If the queue is polled or should use interrupts 43 * 44 */ 45errval_t ip_create(struct ip_q** q, const char* card_name, uint64_t* qid, 46 uint8_t prot, uint32_t dst_ip, void(*interrupt)(void*), 47 bool poll); 48#endif /* DEVIF_IP_H_ */ 49