1*edde50fdShshoexer /* $OpenBSD: udp.h,v 1.11 2005/02/25 14:14:31 hshoexer Exp $ */ 250fbe797Sniklas /* $EOM: udp.h,v 1.4 1998/12/22 02:23:43 niklas Exp $ */ 32040585eSniklas 42040585eSniklas /* 52040585eSniklas * Copyright (c) 1998 Niklas Hallqvist. All rights reserved. 62040585eSniklas * 72040585eSniklas * Redistribution and use in source and binary forms, with or without 82040585eSniklas * modification, are permitted provided that the following conditions 92040585eSniklas * are met: 102040585eSniklas * 1. Redistributions of source code must retain the above copyright 112040585eSniklas * notice, this list of conditions and the following disclaimer. 122040585eSniklas * 2. Redistributions in binary form must reproduce the above copyright 132040585eSniklas * notice, this list of conditions and the following disclaimer in the 142040585eSniklas * documentation and/or other materials provided with the distribution. 152040585eSniklas * 162040585eSniklas * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 172040585eSniklas * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 182040585eSniklas * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 192040585eSniklas * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 202040585eSniklas * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 212040585eSniklas * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 222040585eSniklas * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 232040585eSniklas * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 242040585eSniklas * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 252040585eSniklas * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 262040585eSniklas */ 272040585eSniklas 282040585eSniklas /* 292040585eSniklas * This code was written under funding by Ericsson Radio Systems. 302040585eSniklas */ 312040585eSniklas 322040585eSniklas #ifndef _UDP_H_ 332040585eSniklas #define _UDP_H_ 342040585eSniklas 35a86dabf6Sho extern char *udp_default_port; 36e2cc3c2eSho extern int bind_family; 37e2cc3c2eSho 38e2cc3c2eSho #define BIND_FAMILY_INET4 0x0001 39e2cc3c2eSho #define BIND_FAMILY_INET6 0x0002 402040585eSniklas 41cd6bf844Sho struct transport *udp_bind(const struct sockaddr *); 42cd6bf844Sho void udp_init(void); 43cd6bf844Sho 44cd6bf844Sho struct udp_transport { 45cd6bf844Sho struct transport transport; 46cd6bf844Sho struct sockaddr *src; 47cd6bf844Sho struct sockaddr *dst; 48cd6bf844Sho int s; 49cd6bf844Sho }; 502040585eSniklas 512040585eSniklas #endif /* _UDP_H_ */ 52