11.1Sriastrad/* $NetBSD: wg_user.h,v 1.1 2020/08/26 16:03:42 riastradh Exp $ */ 21.1Sriastrad 31.1Sriastrad/* 41.1Sriastrad * Copyright (C) Ryota Ozaki <ozaki.ryota@gmail.com> 51.1Sriastrad * All rights reserved. 61.1Sriastrad * 71.1Sriastrad * Redistribution and use in source and binary forms, with or without 81.1Sriastrad * modification, are permitted provided that the following conditions 91.1Sriastrad * are met: 101.1Sriastrad * 1. Redistributions of source code must retain the above copyright 111.1Sriastrad * notice, this list of conditions and the following disclaimer. 121.1Sriastrad * 2. Redistributions in binary form must reproduce the above copyright 131.1Sriastrad * notice, this list of conditions and the following disclaimer in the 141.1Sriastrad * documentation and/or other materials provided with the distribution. 151.1Sriastrad * 161.1Sriastrad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 171.1Sriastrad * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 181.1Sriastrad * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 191.1Sriastrad * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 201.1Sriastrad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 211.1Sriastrad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 221.1Sriastrad * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 231.1Sriastrad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241.1Sriastrad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251.1Sriastrad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261.1Sriastrad * SUCH DAMAGE. 271.1Sriastrad */ 281.1Sriastrad 291.1Sriastradstruct wg_user; 301.1Sriastradstruct wg_softc; 311.1Sriastrad 321.1Sriastrad/* 331.1Sriastrad * Defined in wg_user.c and called from if_wg.c. 341.1Sriastrad */ 351.1Sriastradint rumpuser_wg_create(const char *tun_name, struct wg_softc *, 361.1Sriastrad struct wg_user **); 371.1Sriastradvoid rumpuser_wg_destroy(struct wg_user *); 381.1Sriastrad 391.1Sriastradvoid rumpuser_wg_send_user(struct wg_user *, struct iovec *, size_t); 401.1Sriastradint rumpuser_wg_send_peer(struct wg_user *, struct sockaddr *, 411.1Sriastrad struct iovec *, size_t); 421.1Sriastrad 431.1Sriastradint rumpuser_wg_ioctl(struct wg_user *, u_long, void *, int); 441.1Sriastradint rumpuser_wg_sock_bind(struct wg_user *, const uint16_t); 451.1Sriastrad 461.1Sriastradchar * rumpuser_wg_get_tunname(struct wg_user *); 471.1Sriastrad 481.1Sriastrad/* 491.1Sriastrad * Defined in if_wg.c and called from wg_user.c. 501.1Sriastrad */ 511.1Sriastradvoid rumpkern_wg_recv_user(struct wg_softc *, struct iovec *, size_t); 521.1Sriastradvoid rumpkern_wg_recv_peer(struct wg_softc *, struct iovec *, size_t); 53