alias_local.h (179480) | alias_local.h (188294) |
---|---|
1/*- 2 * Copyright (c) 2001 Charles Mott <cm@linktel.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2001 Charles Mott <cm@linktel.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/netinet/libalias/alias_local.h 179480 2008-06-01 18:34:58Z mav $ | 26 * $FreeBSD: head/sys/netinet/libalias/alias_local.h 188294 2009-02-07 18:49:42Z piso $ |
27 */ 28 29/* 30 * Alias_local.h contains the function prototypes for alias.c, 31 * alias_db.c, alias_util.c and alias_ftp.c, alias_irc.c (as well 32 * as any future add-ons). It also includes macros, globals and 33 * struct definitions shared by more than one alias*.c file. 34 * --- 17 unchanged lines hidden (view full) --- 52#ifdef _KERNEL 53#include <sys/malloc.h> 54#include <sys/param.h> 55#include <sys/lock.h> 56#include <sys/mutex.h> 57 58/* XXX: LibAliasSetTarget() uses this constant. */ 59#define INADDR_NONE 0xffffffff | 27 */ 28 29/* 30 * Alias_local.h contains the function prototypes for alias.c, 31 * alias_db.c, alias_util.c and alias_ftp.c, alias_irc.c (as well 32 * as any future add-ons). It also includes macros, globals and 33 * struct definitions shared by more than one alias*.c file. 34 * --- 17 unchanged lines hidden (view full) --- 52#ifdef _KERNEL 53#include <sys/malloc.h> 54#include <sys/param.h> 55#include <sys/lock.h> 56#include <sys/mutex.h> 57 58/* XXX: LibAliasSetTarget() uses this constant. */ 59#define INADDR_NONE 0xffffffff |
60 61#include <netinet/libalias/alias_sctp.h> 62#else 63#include "alias_sctp.h" |
|
60#endif 61 62/* Sizes of input and output link tables */ 63#define LINK_TABLE_OUT_SIZE 4001 64#define LINK_TABLE_IN_SIZE 4001 65 66struct proxy_entry; 67 --- 74 unchanged lines hidden (view full) --- 142 143 unsigned int skinnyPort; /* TCP port used by the Skinny */ 144 /* protocol. */ 145 146 struct proxy_entry *proxyList; 147 148 struct in_addr true_addr; /* in network byte order. */ 149 u_short true_port; /* in host byte order. */ | 64#endif 65 66/* Sizes of input and output link tables */ 67#define LINK_TABLE_OUT_SIZE 4001 68#define LINK_TABLE_IN_SIZE 4001 69 70struct proxy_entry; 71 --- 74 unchanged lines hidden (view full) --- 146 147 unsigned int skinnyPort; /* TCP port used by the Skinny */ 148 /* protocol. */ 149 150 struct proxy_entry *proxyList; 151 152 struct in_addr true_addr; /* in network byte order. */ 153 u_short true_port; /* in host byte order. */ |
154 155 /* 156 * sctp code support 157 */ 158 159 /* counts associations that have progressed to UP and not yet removed */ 160 int sctpLinkCount; |
|
150#ifdef _KERNEL | 161#ifdef _KERNEL |
162 /* timing queue for keeping track of association timeouts */ 163 struct sctp_nat_timer sctpNatTimer; 164 165 /* size of hash table used in this instance */ 166 u_int sctpNatTableSize; 167 168/* 169 * local look up table sorted by l_vtag/l_port 170 */ 171 LIST_HEAD(sctpNatTableL, sctp_nat_assoc) *sctpTableLocal; 172/* 173 * global look up table sorted by g_vtag/g_port 174 */ 175 LIST_HEAD(sctpNatTableG, sctp_nat_assoc) *sctpTableGlobal; 176 |
|
151 /* 152 * avoid races in libalias: every public function has to use it. 153 */ 154 struct mtx mutex; 155#endif 156}; 157 158/* Macros */ --- 35 unchanged lines hidden (view full) --- 194 cksum = (u_short) acc; \ 195 } \ 196 } while (0) 197 198 199/* Prototypes */ 200 201/* | 177 /* 178 * avoid races in libalias: every public function has to use it. 179 */ 180 struct mtx mutex; 181#endif 182}; 183 184/* Macros */ --- 35 unchanged lines hidden (view full) --- 220 cksum = (u_short) acc; \ 221 } \ 222 } while (0) 223 224 225/* Prototypes */ 226 227/* |
228 * SctpFunction prototypes 229 * 230 */ 231void AliasSctpInit(struct libalias *la); 232void AliasSctpTerm(struct libalias *la); 233int SctpAlias(struct libalias *la, struct ip *ip, int direction); 234 235/* |
|
202 * We do not calculate TCP checksums when libalias is a kernel 203 * module, since it has no idea about checksum offloading. 204 * If TCP data has changed, then we just set checksum to zero, 205 * and caller must recalculate it himself. 206 * In case if libalias will edit UDP data, the same approach 207 * should be used. 208 */ 209#ifndef _KERNEL --- 49 unchanged lines hidden (view full) --- 259 struct in_addr _alias_addr, u_int16_t _alias_call_id); 260struct alias_link * 261FindRtspOut(struct libalias *la, struct in_addr _src_addr, struct in_addr _dst_addr, 262 u_short _src_port, u_short _alias_port, u_char _proto); 263struct in_addr 264 FindOriginalAddress(struct libalias *la, struct in_addr _alias_addr); 265struct in_addr 266 FindAliasAddress(struct libalias *la, struct in_addr _original_addr); | 236 * We do not calculate TCP checksums when libalias is a kernel 237 * module, since it has no idea about checksum offloading. 238 * If TCP data has changed, then we just set checksum to zero, 239 * and caller must recalculate it himself. 240 * In case if libalias will edit UDP data, the same approach 241 * should be used. 242 */ 243#ifndef _KERNEL --- 49 unchanged lines hidden (view full) --- 293 struct in_addr _alias_addr, u_int16_t _alias_call_id); 294struct alias_link * 295FindRtspOut(struct libalias *la, struct in_addr _src_addr, struct in_addr _dst_addr, 296 u_short _src_port, u_short _alias_port, u_char _proto); 297struct in_addr 298 FindOriginalAddress(struct libalias *la, struct in_addr _alias_addr); 299struct in_addr 300 FindAliasAddress(struct libalias *la, struct in_addr _original_addr); |
301struct in_addr 302FindSctpRedirectAddress(struct libalias *la, struct sctp_nat_msg *sm); |
|
267 268/* External data access/modification */ 269int 270FindNewPortGroup(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, 271 u_short _src_port, u_short _dst_port, u_short _port_count, 272 u_char _proto, u_char _align); 273void GetFragmentAddr(struct alias_link *_lnk, struct in_addr *_src_addr); 274void SetFragmentAddr(struct alias_link *_lnk, struct in_addr _src_addr); --- 87 unchanged lines hidden --- | 303 304/* External data access/modification */ 305int 306FindNewPortGroup(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, 307 u_short _src_port, u_short _dst_port, u_short _port_count, 308 u_char _proto, u_char _align); 309void GetFragmentAddr(struct alias_link *_lnk, struct in_addr *_src_addr); 310void SetFragmentAddr(struct alias_link *_lnk, struct in_addr _src_addr); --- 87 unchanged lines hidden --- |