1294452Sbrooks/*
2294452Sbrooks * Copyright (c) 1982, 1986, 1993
3294452Sbrooks *	The Regents of the University of California.
4294452Sbrooks * Copyright (c) 2005 Andre Oppermann, Internet Business Solutions AG.
5294452Sbrooks * All rights reserved.
6294452Sbrooks *
7294452Sbrooks * Redistribution and use in source and binary forms, with or without
8294452Sbrooks * modification, are permitted provided that the following conditions
9294452Sbrooks * are met:
10294452Sbrooks * 1. Redistributions of source code must retain the above copyright
11294452Sbrooks *    notice, this list of conditions and the following disclaimer.
12294452Sbrooks * 2. Redistributions in binary form must reproduce the above copyright
13294452Sbrooks *    notice, this list of conditions and the following disclaimer in the
14294452Sbrooks *    documentation and/or other materials provided with the distribution.
15294452Sbrooks * 4. Neither the name of the University nor the names of its contributors
16294452Sbrooks *    may be used to endorse or promote products derived from this software
17294452Sbrooks *    without specific prior written permission.
18294452Sbrooks *
19294452Sbrooks * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20294452Sbrooks * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21294452Sbrooks * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22294452Sbrooks * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23294452Sbrooks * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24294452Sbrooks * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25294452Sbrooks * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26294452Sbrooks * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27294452Sbrooks * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28294452Sbrooks * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29294452Sbrooks * SUCH DAMAGE.
30294452Sbrooks *
31294452Sbrooks * $FreeBSD$
32294452Sbrooks */
33294452Sbrooks
34294452Sbrooks#ifndef _NETINET_IP_OPTIONS_H_
35294452Sbrooks#define	_NETINET_IP_OPTIONS_H_
36294452Sbrooks
37294452Sbrooksstruct ipoptrt {
38294452Sbrooks        struct  in_addr dst;                    /* final destination */
39294452Sbrooks        char    nop;                            /* one NOP to align */
40294452Sbrooks        char    srcopt[IPOPT_OFFSET + 1];       /* OPTVAL, OLEN and OFFSET */
41294452Sbrooks        struct  in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
42294452Sbrooks};
43294452Sbrooks
44294452Sbrooksstruct ipopt_tag {
45294452Sbrooks	struct	m_tag tag;			/* m_tag */
46294452Sbrooks	int	ip_nhops;
47294452Sbrooks	struct	ipoptrt ip_srcrt;
48294452Sbrooks};
49294452Sbrooks
50294452SbrooksVNET_DECLARE(int, ip_doopts);		/* process or ignore IP options */
51294452Sbrooks#define	V_ip_doopts	VNET(ip_doopts)
52294452Sbrooks
53294452Sbrooksint		 ip_checkrouteralert(struct mbuf *);
54294452Sbrooksint		 ip_dooptions(struct mbuf *, int);
55294452Sbrooksstruct mbuf	*ip_insertoptions(struct mbuf *, struct mbuf *, int *);
56294452Sbrooksint		 ip_optcopy(struct ip *, struct ip *);
57294452Sbrooksint		 ip_pcbopts(struct inpcb *, int, struct mbuf *);
58294452Sbrooksvoid		 ip_stripoptions(struct mbuf *);
59294452Sbrooksstruct mbuf	*ip_srcroute(struct mbuf *);
60294452Sbrooks
61294452Sbrooks#endif /* !_NETINET_IP_OPTIONS_H_ */
62294452Sbrooks