summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias/alias.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't spam the console with loaded modules during boot and/or duringn_hibma2010-11-031-1/+0
| | | | | | | startup of ppp. Note: This cannot be hidden behind bootverbose as this file is included from lib/libalias as well.
* Close a stream file descriptor leak.brueffer2009-10-281-0/+1
| | | | | | PR: 138130 Submitted by: Patroklos Argyroudis <argp@census-labs.com> MFC after: 1 week
* What's the point of adjusting a checksum if we are going to toss thepiso2009-04-111-7/+4
| | | | packet? Anticipate the check/return code.
* Plug two bugs introduced with modules conversion:piso2009-04-111-2/+2
| | | | | | -UdpAliasIn(): correctly check return code after modules ran. -alias_nbt: in case of malformed packets (or some other unrecoverable error), toss the packet.
* Remove stale comments.piso2009-04-111-3/+0
|
* Add SCTP NAT support.piso2009-02-071-2/+24
|\ | | | | | | Submitted by: CAIA (http://caia.swin.edu.au)
| * Import sctp nat support in ipfw obtained from CAIA - http://caia.swin.edu.au.piso2008-12-281-2/+37
|/
* Implement UDP transparent proxy support.mav2008-06-211-10/+76
| | | | | PR: bin/54274 Submitted by: Nicolai Petri <nicolai@petri.cc>
* Make m_megapullup() more intelligent:mav2008-06-011-12/+32
| | | | | | - to increase performance do not reallocate mbuf when possible, - to support up to 16K packets (was 2K max) use mbuf cluster of proper size. This change depends on recent ng_nat and ip_fw_nat changes.
* Fix packet fragmentation support broken by copy/paste error in rev.1.60.mav2008-06-011-2/+2
| | | | ip_id should be u_short, but not u_char.
* Fix build, together with a bit of style breakage.marck2008-05-021-1/+1
|
* -Don't pass down the entire pkt to ProtoAliasIn, ProtoAliasOut, FragmentInpiso2008-03-121-35/+43
| | | | | and FragmentOut. -Axe the old PacketAlias API: it has been deprecated since 5.x.
* MFP4:piso2008-03-061-30/+29
| | | | | | restrict the utilization of direct pointers to the content of ip packet. These modifications are functionally nop()s thus can be merged with no side effects.
* o made in kernel libalias mpsafepiso2006-12-151-30/+90
| | | | | | | | o fixed a comment o made in kernel libalias a bit less verbose (disabled automatic logging everytime a new link is added or deleted) Approved by: glebius (mentor)
* Make libalias.conf parsing a bit smarter.piso2006-12-011-10/+18
| | | | | | | | This closes PR kern/106112. While here, add mbuf's #includes i forgot in the previous commit. Approved by: gleb
* Remove m_megapullup from ng_nat and put it under libalias.piso2006-12-011-0/+38
| | | | Approved by: gleb
* Summer of Code 2005: improve libalias - part 1 of 2piso2006-09-261-80/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the first part of my previous Summer of Code work, we get: -made libalias modular: -support for 'particular' protocols (like ftp/irc/etcetc) is no more hardcoded inside libalias, but it's available through external modules loadable at runtime -modules are available both in kernel (/boot/kernel/alias_*.ko) and user land (/lib/libalias_*) -protocols/applications modularized are: cuseeme, ftp, irc, nbt, pptp, skinny and smedia -added logging support for kernel side -cleanup After a buildworld, do a 'mergemaster -i' to install the file libalias.conf in /etc or manually copy it. During startup (and after every HUP signal) user land applications running the new libalias will try to read a file in /etc called libalias.conf: that file contains the list of modules to load. User land applications affected by this commit are ppp and natd: if libalias.conf is present in /etc you won't notice any difference. The only kernel land bit affected by this commit is ng_nat: if you are using ng_nat, and it doesn't correctly handle ftp/irc/etcetc sessions anymore, remember to kldload the correspondent module (i.e. kldload alias_ftp). General information and details about the inner working are available in the libalias man page under the section 'MODULAR ARCHITECTURE (AND ipfw(4) SUPPORT)'. NOTA BENE: this commit affects _ONLY_ libalias, ipfw in-kernel nat support will be part of the next libalias-related commit. Approved by: glebius Reviewed by: glebius, ru
* Libalias incorrectly applies proxy rules to the global divertphk2005-06-271-1/+5
| | | | | | | socket: it should only look for existing translation entries, not create new ones (no matter how it got the idea). Approved by: re(scottl)
* Always include alias.h before alias_local.hglebius2005-05-051-2/+2
|
* Play with includes so that libalias can be compiled both as userlandglebius2005-05-051-2/+10
| | | | library and kernel module.
* natd core dumps when -reverse switch is used because of a bug inphk2005-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | libalias. In /usr/src/lib/libalias/alias.c, the functions LibAliasIn and LibAliasOutTry call the legacy PacketAliasIn/PacketAliasOut instead of LibAliasIn/LibAliasOut when the PKT_ALIAS_REVERSE option is set. In this case, the context variable "la" gets lost because the legacy compatibility routines expect "la" to be global. This was obviously an oversight when rewriting the PacketAlias* functions to the LibAlias* functions. The fix (as shown in the patch below) is to remove the legacy subroutine calls and replace with the new ones using the "la" struct as the first arg. Submitted by: Gil Kloepfer <fgil@kloepfer.org> Confirmed by: <nicolai@catpipe.net> PR: 76839 MFC after: 3 days
* Fix outgoing ICMP on global instance.phk2004-08-141-5/+5
|
* Introduce inline {ip,udp,tcp}_next() functions which take a pointer to andes2004-07-061-22/+22
| | | | | | | {ip,udp,tcp} header and return a void * pointing to the payload (i.e. the first byte past the end of the header and any required padding). Use them consistently throughout libalias to a) reduce code duplication, b) improve code legibility, c) get rid of a bunch of alignment warnings.
* Rewrite twowords() to access its argument through a char pointer and notdes2004-07-061-3/+10
| | | | | | a short pointer. The previous implementation seems to be in a gray zone of the C standard, and GCC generates incorrect code for it at -O2 or higher on some platforms.
* Make libalias WARNS?=6-clean. This mostly involves renaming variablesdes2004-07-051-124/+129
| | | | | | | | | named link, foo_link or link_foo to lnk, foo_lnk or lnk_foo, fixing signed / unsigned comparisons, and shoving unused function arguments under the carpet. I was hoping WARNS?=6 might reveal more serious problems, and perhaps the source of the -O2 breakage, but found no smoking gun.
* Parenthesize return values.des2004-07-051-11/+11
|
* Mechanical whitespace cleanup.des2004-07-051-42/+42
|
* Add LibAliasOutTry() which checks a packet for a hit in the tables, butphk2004-07-041-16/+28
| | | | does not create a new entry if none is found.
* Unbreak natd.deischen2004-04-021-0/+1
| | | | Reported and submitted by: Sean McNeil (sean at mcneil.com)
* Deal with aliasing warnings.des2004-03-311-172/+57
| | | | | Reviewed by: ru Approved by: silence on the lists
* Run through indent(1) so I can read the code without getting a headache.des2004-03-161-1045/+976
| | | | | The result isn't quite knf, but it's knfer than the original, and far more consistent.
* Mostly mechanical rework of libalias:phk2004-01-171-121/+121
| | | | | | | | | | | | Makes it possible to have multiple packet aliasing instances in a single process by moving all static and global variables into an instance structure called "struct libalias". Redefine a new API based on s/PacketAlias/LibAlias/g Add new "instance" argument to all functions in the new API. Implement old API in terms of the new API.
* Add Cisco Skinny Station protocol support to libalias, natd, and ppp.marcus2003-09-231-0/+6
| | | | | | | | | | | | | | | Skinny is the protocol used by Cisco IP phones to talk to Cisco Call Managers. With this code, one can use a Cisco IP phone behind a FreeBSD NAT gateway. Currently, having the Call Manager behind the NAT gateway is not supported. More information on enabling Skinny support in libalias, natd, and ppp can be found in those applications' manpages. PR: 55843 Reviewed by: ru Approved by: ru MFC after: 30 days
* In the PKT_ALIAS_PROXY_ONLY mode, make sure to preserve theru2003-06-131-0/+4
| | | | | | original source IP address, as promised in the manual page. Spotted by: Vaclav Petricek
* Don't forget to recalculate the IP checksum of the originalru2002-07-231-4/+12
| | | | | | | IP datagram embedded into ICMP error message. Spotted by: tcpdump 3.7.1 (-vvv) MFC after: 3 days
* Remove trailing whitespacebrian2002-07-011-23/+23
|
* Fixed the bug in transparent TCP proxying with the "encode_ip_hdr"ru2001-12-181-1/+3
| | | | | | option -- TcpAliasOut() did not catch the IP header length change. Submitted by: Stepachev Andrey <aka50@mail.ru>
* cmott@scientech.com -> cm@linktel.netbrian2001-11-031-1/+1
| | | | Requested by: Charles Mott <cmott@scientech.com>
* Add __FBSDID's to libaliasdillon2001-09-301-2/+3
|
* Added TFTP support.ru2001-08-211-0/+9
| | | | | Submitted by: Joe Clarke <marcus@marcuscom.com> MFC after: 2 weeks
* Make the copyright consistent.brian2001-08-201-3/+0
| | | | Previously approved by: Charles Mott <cmott@scientech.com>
* Add BSD-style copyright headersbrian2001-06-041-2/+29
| | | | Approved by: Charles Mott <cmott@scientech.com>
* Make header files conform to style(9).brian2001-03-251-13/+15
| | | | | | Reviewed by (*): bde (*) alias_local.h only got a cursory glance.
* Added boolean argument to link searching functions, indicatingru2000-10-301-17/+18
| | | | whether they should create a link if lookup has failed or not.
* A significant rewrite of PPTP aliasing code.ru2000-10-301-39/+12
| | | | | | | | | | | | | | PPTP links are no longer dropped by simple (and inappropriate in this case) "inactivity timeout" procedure, only when requested through the control connection. It is now possible to have multiple PPTP servers running behind NAT. Just redirect the incoming TCP traffic to port 1723, everything else is done transparently. Problems were reported and the fix was tested by: Michael Adler <Michael.Adler@compaq.com>, David Andersen <dga@lcs.mit.edu>
* A bit of indentation reformatting.ru2000-10-021-33/+21
|
* Match IPPROTO_ICMP with IP protocol field of the original IPru2000-09-011-2/+2
| | | | | | | datagram embedded into ICMP error message, not with protocol field of ICMP message itself (which is always IPPROTO_ICMP). Pointed by: Erik Salander <erik@whistle.com>
* Changed the way we handle outgoing ICMP error messages -- doru2000-09-011-12/+22
| | | | | | | | not alias `ip_src' unless it comes from the host an original datagram that triggered this error message was destined for. PR: 20712 Reviewed by: brian, Charles Mott <cmott@scientech.com>
* Create aliasing links for incoming ICMP echo/timestamp requests.ru2000-08-311-46/+10
| | | | | This makes outgoing ICMP echo/timestamp replies to be de-aliased with the right source IP, not exactly the primary aliasing IP.
* Add address translation support for RTSP/RTP used by RealPlayer andarchie2000-07-261-1/+134
| | | | | | | | Quicktime streaming media applications. Add a BUGS section to the man page. Submitted by: Erik Salander <erik@whistle.com>
OpenPOWER on IntegriCloud