184659b24SMichael Zeller /*- 2*32640292SAndy Fiddaman * SPDX-License-Identifier: BSD-2-Clause 384659b24SMichael Zeller * 484659b24SMichael Zeller * Copyright (c) 2019 Vincenzo Maffione <v.maffione@gmail.com> 584659b24SMichael Zeller * 684659b24SMichael Zeller * Redistribution and use in source and binary forms, with or without 784659b24SMichael Zeller * modification, are permitted provided that the following conditions 884659b24SMichael Zeller * are met: 984659b24SMichael Zeller * 1. Redistributions of source code must retain the above copyright 1084659b24SMichael Zeller * notice, this list of conditions and the following disclaimer. 1184659b24SMichael Zeller * 2. Redistributions in binary form must reproduce the above copyright 1284659b24SMichael Zeller * notice, this list of conditions and the following disclaimer in the 1384659b24SMichael Zeller * documentation and/or other materials provided with the distribution. 1484659b24SMichael Zeller * 1584659b24SMichael Zeller * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND 1684659b24SMichael Zeller * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1784659b24SMichael Zeller * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1884659b24SMichael Zeller * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 1984659b24SMichael Zeller * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 2084659b24SMichael Zeller * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 2184659b24SMichael Zeller * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 2284659b24SMichael Zeller * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2384659b24SMichael Zeller * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 2484659b24SMichael Zeller * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 2584659b24SMichael Zeller * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2684659b24SMichael Zeller */ 2784659b24SMichael Zeller 2884659b24SMichael Zeller #ifndef _NET_UTILS_H_ 2984659b24SMichael Zeller #define _NET_UTILS_H_ 3084659b24SMichael Zeller 3184659b24SMichael Zeller #include <stdint.h> 3284659b24SMichael Zeller #include "pci_emul.h" 3384659b24SMichael Zeller 3484659b24SMichael Zeller void net_genmac(struct pci_devinst *pi, uint8_t *macaddr); 352b948146SAndy Fiddaman int net_parsemac(const char *mac_str, uint8_t *mac_addr); 36154972afSPatrick Mooney int net_parsemtu(const char *mtu_str, unsigned long *mtu); 3784659b24SMichael Zeller 3884659b24SMichael Zeller #endif /* _NET_UTILS_H_ */ 39