1152592Sandre/* 2152592Sandre * Copyright (c) 1982, 1986, 1993 3169464Srwatson * The Regents of the University of California. 4169464Srwatson * Copyright (c) 2005 Andre Oppermann, Internet Business Solutions AG. 5169464Srwatson * All rights reserved. 6152592Sandre * 7152592Sandre * Redistribution and use in source and binary forms, with or without 8152592Sandre * modification, are permitted provided that the following conditions 9152592Sandre * are met: 10152592Sandre * 1. Redistributions of source code must retain the above copyright 11152592Sandre * notice, this list of conditions and the following disclaimer. 12152592Sandre * 2. Redistributions in binary form must reproduce the above copyright 13152592Sandre * notice, this list of conditions and the following disclaimer in the 14152592Sandre * documentation and/or other materials provided with the distribution. 15152592Sandre * 4. Neither the name of the University nor the names of its contributors 16152592Sandre * may be used to endorse or promote products derived from this software 17152592Sandre * without specific prior written permission. 18152592Sandre * 19152592Sandre * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20152592Sandre * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21152592Sandre * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22152592Sandre * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23152592Sandre * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24152592Sandre * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25152592Sandre * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26152592Sandre * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27152592Sandre * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28152592Sandre * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29152592Sandre * SUCH DAMAGE. 30152592Sandre * 31152592Sandre * $FreeBSD$ 32152592Sandre */ 33152592Sandre 34152592Sandre#ifndef _NETINET_IP_OPTIONS_H_ 35152592Sandre#define _NETINET_IP_OPTIONS_H_ 36152592Sandre 37152592Sandrestruct ipoptrt { 38152592Sandre struct in_addr dst; /* final destination */ 39152592Sandre char nop; /* one NOP to align */ 40152592Sandre char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */ 41152592Sandre struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)]; 42152592Sandre}; 43152592Sandre 44152592Sandrestruct ipopt_tag { 45152592Sandre struct m_tag tag; /* m_tag */ 46152592Sandre int ip_nhops; 47152592Sandre struct ipoptrt ip_srcrt; 48152592Sandre}; 49152592Sandre 50271610ShrsVNET_DECLARE(int, ip_doopts); /* process or ignore IP options */ 51271610Shrs#define V_ip_doopts VNET(ip_doopts) 52152592Sandre 53189343Sbmsint ip_checkrouteralert(struct mbuf *); 54169464Srwatsonint ip_dooptions(struct mbuf *, int); 55169464Srwatsonstruct mbuf *ip_insertoptions(struct mbuf *, struct mbuf *, int *); 56169464Srwatsonint ip_optcopy(struct ip *, struct ip *); 57169464Srwatsonint ip_pcbopts(struct inpcb *, int, struct mbuf *); 58241480Sglebiusvoid ip_stripoptions(struct mbuf *); 59169464Srwatsonstruct mbuf *ip_srcroute(struct mbuf *); 60152592Sandre 61152592Sandre#endif /* !_NETINET_IP_OPTIONS_H_ */ 62