summaryrefslogtreecommitdiff
path: root/lib/libalias
Commit message (Collapse)AuthorAgeFilesLines
* Fixed PunchFWHole():Ruslan Ermilov2000-06-271-2/+3
| | | | | | | | - ipfw always rejected rule with `neither in nor out' diagnostics. - number of src/dst ports was not set properly. Notes: svn path=/head/; revision=62159
* - Removed PacketAliasPptp() API function.Ruslan Ermilov2000-06-204-38/+1
| | | | | | | - SHLIB_MAJOR++. Notes: svn path=/head/; revision=61865
* Added true support for PPTP aliasing. Some nice features include:Ruslan Ermilov2000-06-207-11/+422
| | | | | | | | | | | | | | | | | | | | | | | - Multiple PPTP clients behind NAT to the same or different servers. - Single PPTP server behind NAT -- you just need to redirect TCP port 1723 to a local machine. Multiple servers behind NAT is possible but would require a simple API change. - No API changes! For more information on how this works see comments at the start of the alias_pptp.c. PacketAliasPptp() is no longer necessary and will be removed soon. Submitted by: Erik Salander <erik@whistle.com> Reviewed by: ru Rewritten by: ru Reviewed by: Erik Salander <erik@whistle.com> Notes: svn path=/head/; revision=61861
* - Improved passive mode FTP support by aliasing 229 replies.Ruslan Ermilov2000-06-161-312/+337
| | | | | | | | - Stricter checking of PORT/EPRT/227/229 messages format. - Moved all security checks into one place. Notes: svn path=/head/; revision=61735
* - Added support for passive mode FTP by aliasing 227 replies.Ruslan Ermilov2000-06-143-15/+228
| | | | | | | | | | | | | | | | | | It does mean that it is now possible to run passive-mode FTP server behind NAT. - SECURITY: FTP aliasing engine now ensures that: o the segment preceding a PORT/227 segment terminates with a \r\n; o the IP address in the PORT/227 matches the source IP address of the packet; o the port number in the PORT command or 277 reply is greater than or equal to 1024. Submitted by: Erik Salander <erik@whistle.com> Reviewed by: ru Notes: svn path=/head/; revision=61677
* Revert the default behaviour for incoming connections soBrian Somers2000-05-112-3/+3
| | | | | | | | | | | that they (once again) go to the target machine rather than the alias address. PR: 18354 Submitted by: ru Notes: svn path=/head/; revision=60363
* Replace PacketAliasRedirectPptp() (which had nothing specificRuslan Ermilov2000-04-285-111/+88
| | | | | | | | | | to PPTP) with more generic PacketAliasRedirectProto(). Major number is not bumped because it is believed that noone has started using PacketAliasRedirectPptp() yet. Notes: svn path=/head/; revision=59726
* Spell PacketAliasRedirectAddr() correctly.Ruslan Ermilov2000-04-271-1/+1
| | | | Notes: svn path=/head/; revision=59704
* Load Sharing using IP Network Address Translation (RFC 2391, LSNAT).Ruslan Ermilov2000-04-273-27/+150
| | | | | | | | | LSNAT links are first created by either PacketAliasRedirectPort() or PacketAliasRedirectAddress() and then set up by one or more calls to PacketAliasAddServer(). Notes: svn path=/head/; revision=59702
* Add support for multiple PPTP sessions:Ruslan Ermilov2000-04-185-88/+265
| | | | | | | | | | - new API function: PacketAliasRedirectPptp() - new mode bit: PKT_ALIAS_DENY_PPTP Please see manual page for details. Notes: svn path=/head/; revision=59356
* Apply TCP_EXPIRE_CONNECTED (86400 seconds) timeout only to establishedRuslan Ermilov2000-04-141-16/+10
| | | | | | | | | | | | | | | | | connections, after SYN packets were seen from both ends. Before this, it would get applied right after the first SYN packet was seen (either from client or server). With broken TCP connection attempts, when the remote end does not respond with SYNACK nor with RST, this resulted in having a useless (ie, no actual TCP connection associated with it) TCP link with 86400 seconds TTL, wasting system memory. With high rate of such broken connection attempts (for example, remote end simply blocks these connection attempts with ipfw(8) without sending RST back), this could result in a denial-of-service. PR: bin/17963 Notes: svn path=/head/; revision=59237
* A complete reformatting of manual page.Ruslan Ermilov2000-04-131-724/+686
| | | | Notes: svn path=/head/; revision=59202
* Make partially specified permanent links without `dst_addr'Ruslan Ermilov2000-04-121-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | but with `dst_port' work for outgoing packets. This case was not handled properly when I first fixed this in revision 1.17. This change is also required for the upcoming improved PPTP support patches -- that is how I found the problem. Before this change: # natd -v -a aliasIP \ -redirect_port tcp localIP:localPORT publicIP:publicPORT 0:remotePORT Out [TCP] [TCP] localIP:localPORT -> remoteIP:remotePORT aliased to [TCP] aliasIP:localPORT -> remoteIP:remotePORT After this change: # natd -v -a aliasIP \ -redirect_port tcp localIP:localPORT publicIP:publicPORT 0:remotePORT Out [TCP] [TCP] localIP:localPORT -> remoteIP:remotePORT aliased to [TCP] publicIP:publicPORT -> remoteIP:remotePORT Notes: svn path=/head/; revision=59181
* - Add support for FTP EPRT (RFC 2428) command.Ruslan Ermilov2000-04-061-63/+169
| | | | | | | | | | | | - Minor optimizations. - Minor spelling fixes. PR: 14305 Submitted by: ume Rewritten by: ru Notes: svn path=/head/; revision=59075
* - Remove unused includes.Ruslan Ermilov2000-04-051-24/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Minor spelling fixes. - Make IcmpAliasOut2() really work. Before this change: # natd -v -n PUB_IFACE -p 12345 -redirect_address 192.168.1.1 P.P.P.P natd[87923]: Aliasing to A.A.A.A, mtu 1500 bytes In [UDP] [UDP] X.X.X.X:49562 -> P.P.P.P:50000 aliased to [UDP] X.X.X.X:49562 -> 192.168.1.1:50000 Out [ICMP] [ICMP] 192.168.1.1 -> X.X.X.X 3(3) aliased to [ICMP] A.A.A.A -> X.X.X.X 3(3) # tcpdump -n -t -i PUB_IFACE host X.X.X.X and "(udp or icmp)" tcpdump: listening on PUB_IFACE X.X.X.X.49562 > P.P.P.P.50000: udp 3 A.A.A.A > X.X.X.X: icmp: A.A.A.A udp port 50000 unreachable After this change: # natd -v -n PUB_IFACE -p 12345 -redirect_address 192.168.1.1 P.P.P.P natd[89360]: Aliasing to A.A.A.A, mtu 1500 bytes In [UDP] [UDP] X.X.X.X:49563 -> P.P.P.P:50000 aliased to [UDP] X.X.X.X:49563 -> 192.168.1.1:50000 Out [ICMP] [ICMP] 192.168.1.1 -> X.X.X.X 3(3) aliased to [ICMP] P.P.P.P -> X.X.X.X 3(3) # tcpdump -n -t -i PUB_IFACE host X.X.X.X and "(udp or icmp)" tcpdump: listening on PUB_IFACE X.X.X.X.49563 > P.P.P.P.50000: udp 3 P.P.P.P > X.X.X.X: icmp: P.P.P.P udp port 50000 unreachable Notes: svn path=/head/; revision=59047
* - Moved NULL definition into private include file.Ruslan Ermilov2000-04-052-7/+6
| | | | | | | - Minor spelling fixes. Notes: svn path=/head/; revision=59046
* Minor spelling fixes.Ruslan Ermilov2000-04-052-5/+7
| | | | Notes: svn path=/head/; revision=59031
* Correct Charles Mott's email addressBrian Somers2000-04-021-1/+1
| | | | | | | Requested by: Charles Mott <cmott@scientech.com> Notes: svn path=/head/; revision=58943
* Allow PacketAliasSetTarget() to be passed the following:Brian Somers2000-03-312-13/+22
| | | | | | | | | | | | | INADDR_NONE: Incoming packets go to the alias address (the default) INADDR_ANY: Incoming packets are not NAT'd (direct access to the internal network from outside) anything else: Incoming packets go to the specified address Change a few inaddr::s_addr == 0 to inaddr::s_addr == INADDR_ANY while I'm there. Notes: svn path=/head/; revision=58877
* When an incoming packet is received that is not specificallyBrian Somers2000-03-311-1/+1
| | | | | | | | | | redirected and when no target address has been specified, NAT the destination address to the alias address rather than allowing people direct access to your internal network from outside. Notes: svn path=/head/; revision=58866
* Make _FindLinkIn() static and only define GetDestPort whenBrian Somers2000-03-191-2/+4
| | | | | | | NO_FW_PUNCH isn't defined. Notes: svn path=/head/; revision=58279
* Remove single-space hard sentence breaks. These degrade the qualitySheldon Hearn2000-03-021-1/+2
| | | | | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc. Notes: svn path=/head/; revision=57686
* -it do, among other things, clear out anyAlfred Perlstein2000-02-281-1/+1
| | | | | | | | | +it does, amongst other things, clear out any The old sentance didn't seem to make sense. Notes: svn path=/head/; revision=57544
* The flags PKT_ALIAS_PUNCH_FW and PKT_ALIAS_PROXY_ONLY were bothArchie Cobbs2000-02-021-1/+1
| | | | | | | | | | being defined as 0x40. Change the former to be 0x100. Submitted by: Erik Salander <erik@whistle.com> Approved by: jkh Notes: svn path=/head/; revision=56968
* Mention what PKT_ALIAS_PROXY_ONLY does.Brian Somers2000-02-021-1/+6
| | | | | | | Prompted by: archie Notes: svn path=/head/; revision=56967
* Replace beforeinstall target with new variables used by .mk system.Rodney W. Grimes2000-01-141-4/+1
| | | | | | | Reviewed by: marcel, and make world Notes: svn path=/head/; revision=55955
* Fix a '&&' that should have been a '&'.Archie Cobbs1999-12-101-1/+1
| | | | | | | Submitted by: Erik Salander <erik@whistle.com> Notes: svn path=/head/; revision=54415
* Fix several typos.Archie Cobbs1999-12-091-17/+17
| | | | | | | Submitted by: Erik Salander <erik@whistle.com> Notes: svn path=/head/; revision=54376
* Restore sub-chapters order.Alexey Zelkin1999-11-091-19/+16
| | | | | | | | PR: docs/14766 Submitted by: Kazutoshi Kubota <kazu@iworks.co.jp> Notes: svn path=/head/; revision=53038
* Properly handle the case when either the aliasing or source address ofRuslan Ermilov1999-09-271-26/+66
| | | | | | | | | | | | | | | | the link are equal to the default aliasing address. Do not zero them! This will fix the problem with non-working links added with the source and/or aliasing address equal to the default aliasing address, but the default aliasing address is set later, after the link has been set up, like both natd(8) and ppp(8) do (for objective reasons). Reviewed by: Brian Somers <brian@FreeBSD.org>, Eivind Eklund <eivind@FreeBSD.org>, Charles Mott <cmott@srv.net> Notes: svn path=/head/; revision=51727
* ReLink() partial links in FindLinkOut() in the same manner as we do itRuslan Ermilov1999-09-221-7/+15
| | | | | | | | | in FindLinkIn(). This will make TcpMonitorIn()/TcpMonitorOut() happy. Reviewed by: eivind Notes: svn path=/head/; revision=51550
* Restore previous version of FindLinkIn().Ruslan Ermilov1999-09-211-9/+8
| | | | | | | | Instead, natd(8) should be fixed to call PacketAliasSetAddress() as part of initialization, as required by libalias(3). Notes: svn path=/head/; revision=51506
* - Make partially specified permanent links (without `dst_addr' and/orRuslan Ermilov1999-09-211-11/+25
| | | | | | | | | | | | | | `dst_port') work for outgoing packets. - Make permanent links whose `alias_addr' matches the primary aliasing address `aliasAddress' work for incoming packets. - Typo fixes. Reviewed by: brian, eivind Notes: svn path=/head/; revision=51494
* sys/errno.h -> errno.hBrian Somers1999-09-211-1/+1
| | | | Notes: svn path=/head/; revision=51491
* - Optimization to the previous (rev 1.15) commit.Ruslan Ermilov1999-09-101-9/+11
| | | | | | | | | Requested by: eivind Discussed with: eivind Reviewed by: brian, eivind Notes: svn path=/head/; revision=51125
* Handle TCP reset sequence properly.Ruslan Ermilov1999-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | In the words of originator: :If an incoming connection is initiated through natd and deny_incoming is :not set, then a new alias_link structure is created to handle the link. :If there is nothing listening for the incoming connection, then the kernel :responds with a RST for the connection. However, this is not processed :correctly in libalias/alias.c:TcpMonitor{In,Out} and :libalias/alias_db.c:SetState{In,Out} as it thinks a connection :has been established and therefore applies a timeout of 86400 seconds :to the link. : :If many of these half-connections are initiated (during, for example, a :port scan of the host), then many thousands of unnecessary links are :created and the resident size of natd balloons to 20MB or more. PR: 13639 Reviewed by: brian Notes: svn path=/head/; revision=51107
* Fix typo.Ruslan Ermilov1999-09-081-1/+1
| | | | Notes: svn path=/head/; revision=51091
* Add $FreeBSD$ and spell Eklund properly.Bill Fumerola1999-08-297-1/+14
| | | | | | | Approved by: brian (well, he approved adding $Id$) Notes: svn path=/head/; revision=50597
* $Id$ -> $FreeBSD$Peter Wemm1999-08-285-5/+5
| | | | Notes: svn path=/head/; revision=50476
* Aallow ppp to work with Nortel Networks Extranet SwitchBrian Somers1999-08-221-0/+6
| | | | | | | | | product and Windows NT tunneling. Submitted by: Chain Lee <chain@nortelnetworks.com> Notes: svn path=/head/; revision=50194
* Typo: 102 => 192 (PR: docs/13310 - Maxim Sobolev <sobomax@altavista.net>)Tim Vanderhoek1999-08-221-2/+2
| | | | Notes: svn path=/head/; revision=50175
* Various man page cleanup:Mike Pritchard1999-08-151-17/+12
| | | | | | | | | | | | | - Sort xrefs - FreeBSD.ORG -> FreeBSD.org - Be consistent with section names as outlines in mdoc(7) - Other misc mdoc cleanup. PR: doc/13144 Submitted by: Alexy M. Zelkin <phantom@cris.net> Notes: svn path=/head/; revision=49828
* Don't get caught in an infinite recursion when PKT_ALIAS_REVERSEBrian Somers1999-06-222-5/+18
| | | | | | | | | | | is set. Document PKT_ALIAS_REVERSE. Pointed out by: Jonathan Hanna <jh@cr1003333-a.crdva1.bc.home.com> PR: 12304 Notes: svn path=/head/; revision=48102
* brucifyBrian Somers1999-05-231-2/+2
| | | | | | | Mentioned by: sprice@hiwaay.net Notes: svn path=/head/; revision=47427
* Make incoming packets work as keepalives, too. This should fix problemsEivind Eklund1999-05-201-0/+1
| | | | | | | | | for some games. Notified of problem by: tim@turbinegames.com Notes: svn path=/head/; revision=47344
* Add missing ``.''.Brian Somers1999-05-041-1/+1
| | | | Notes: svn path=/head/; revision=46395
* Work around an egcs optimizer bug (i386). This should fix the active ftpLuoqi Chen1999-04-211-2/+4
| | | | | | | hang problem. A bug report has been sent to cygnus. Notes: svn path=/head/; revision=45926
* PacketAliasProxyRule takes a const char *Brian Somers1999-03-251-1/+1
| | | | | | | Reminded by: bde Notes: svn path=/head/; revision=45025
* Add a ``const'' and remove some inconsistent prototype args.Brian Somers1999-03-243-4/+4
| | | | Notes: svn path=/head/; revision=45008
* Remove duplicate line.Bill Fumerola1999-03-231-1/+0
| | | | | | | Reviewed by: eivind Notes: svn path=/head/; revision=44979