summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/arp.c
Commit message (Collapse)AuthorAgeFilesLines
* SPDX: mostly fixes to previous changes.Pedro F. Giffuni2017-12-131-1/+1
| | | | | | | | Introduce the recently approved BSD-1-Clause and replace 0BSD which never did fit well our use cases. Notes: svn path=/head/; revision=326823
* SPDX: Fix some cases wrongly attributed to MIT.Pedro F. Giffuni2017-11-301-1/+1
| | | | | | | | In the cases of BSD-style license variants without clauses, use 0BSD for the time being in lack of a better description. Notes: svn path=/head/; revision=326398
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Retire struct sockaddr_inarp.Gleb Smirnoff2013-01-311-3/+2
| | | | | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@ Notes: svn path=/head/; revision=246143
* Need to set the proper flag bit when inserting ARPQing Li2010-03-181-1/+1
| | | | | | | | | entries into the kernel. MFC after: 3 days Notes: svn path=/head/; revision=205272
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-8/+8
| | | | Notes: svn path=/head/; revision=134789
* Use the length of the interface name, not the length of its address whenBrooks Davis2004-01-211-1/+1
| | | | | | | | | printing the name. Approved by: brian Notes: svn path=/head/; revision=124815
* socket()s first argument should be a protocol family rather than anBrian Somers2002-01-161-1/+1
| | | | | | | address family. Notes: svn path=/head/; revision=89422
* socket's first argument is an address family, not a protocol family.Brian Somers2002-01-161-1/+1
| | | | Notes: svn path=/head/; revision=89420
* Keep up with sys/net/rtsock.c,v 1.58.Ruslan Ermilov2001-09-211-1/+1
| | | | | | | Prodded by: brian Notes: svn path=/head/; revision=83775
* o Add ipv6 support, abstracting most NCP addresses into opaqueBrian Somers2001-08-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org> Notes: svn path=/head/; revision=81634
* Remove an irritating diagnostic emitted to LogPHASE when aBrian Somers2001-07-311-9/+9
| | | | | | | | | | | | static proxy arp entry is deleted. Rename a function (for consistency) and remove some whitespace (for readability). MFC after: 1 week Notes: svn path=/head/; revision=80730
* Various whitespace changes.Brian Somers2000-10-301-1/+2
| | | | | | | Make some functions static. Notes: svn path=/head/; revision=67912
* The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mibBrian Somers2000-03-141-39/+27
| | | | | | | | | is aligned. Teach this to ``show route''. Clean up some of the sockaddr parsing routines. Notes: svn path=/head/; revision=58032
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.Brian Somers1999-09-211-3/+0
| | | | | | | | | | The original report was due to a mis-installation of the NetBS header files :-/ Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51517
* NetBSD has moved ``extern int errno;'' to signal.h :-/Brian Somers1999-09-201-0/+3
| | | | | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51449
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-05-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | the layering. We now ``stack'' layers as soon as we open the device (when we figure out what we're dealing with). A static set of `dispatch' routines are also declared for dealing with incoming packets after they've been `pulled' up through the stacked layers. Physical devices are now assigned handlers based on the device type when they're opened. For the moment there are three device types; ttys, execs and tcps. o Increment version number to 2.2 o Make an entry in [uw]tmp for non-tty -direct invocations (after pap/chap authentication). o Make throughput counters quad_t's o Account for the absolute number of mbuf malloc()s and free()s in ``show mem''. o ``show modem'' becomes ``show physical''. Notes: svn path=/head/; revision=46686
* #include <errno.h>, not <sys/errno.h>Brian Somers1999-04-261-2/+2
| | | | Notes: svn path=/head/; revision=46085
* Initial RADIUS support (using libradius). See the man page forBrian Somers1999-01-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland Notes: svn path=/head/; revision=43313
* Add ``enable proxyall'' support. This adds proxy ARP entriesBrian Somers1998-10-261-31/+21
| | | | | | | | | | | | | for every machine on every class C or smaller subnet that we route to. Add ``set {send,recv}pipe'' for controlling our socket buffer sizes. Mention the IP number with the problem in a few error messages. All submitted by: Craig Leres <leres@ee.lbl.gov> Modified slightly by: me Notes: svn path=/head/; revision=40665
* Put the IP buffer queues into struct ipcp.Brian Somers1998-08-261-3/+3
| | | | | | | Forgotten by: me Notes: svn path=/head/; revision=38557
* Change some log levels. ALERTs are only logged whenBrian Somers1998-06-161-4/+6
| | | | | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens. Notes: svn path=/head/; revision=37019
* MFMP: Make ppp multilink capable.Brian Somers1998-05-211-81/+54
|\ | | | | | | | | | | | | See the file README.changes, and re-read the man page. Notes: svn path=/head/; revision=36285
| * Cosmetic: Make our external function names consistent.Brian Somers1998-05-011-23/+23
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35605
| * o Add the link name to modem diagnostics.Brian Somers1998-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Create struct mpserver as part of struct mp. mpserver creates a unix-domain socket based on the peers auth name and endpoint discriminator. If it already exists, ppp will ``pass the link'' over to the owner of the socket, joining it into the bundle of another ppp invocation, otherwise ppp waits for other invocations to pass it links through this socket. The final piece of code will be the code that flattens our datalink info and passes it down this channel (not yet implemented). Notes: svn path=/cvs2svn/branches/MP/; revision=35481
| * Create #defines for all endpoint discriptor classes,Brian Somers1998-04-231-6/+4
| | | | | | | | | | | | | | and allow `set enddisc mac'. Notes: svn path=/cvs2svn/branches/MP/; revision=35412
| * o Move alias function pointers into loadalias.cBrian Somers1998-04-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | o Move Var*Version into command.c o Remove struct pppVars (and there was much rejoicing) ! o Forward-decl some structs in .h files to avoid include ordering requirements and remove a few more redundant #includes. Notes: svn path=/cvs2svn/branches/MP/; revision=35089
| * Remove unused includes.Brian Somers1998-04-061-7/+1
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35059
| * o Move struct lcp and struct ccp into struct link.Brian Somers1998-04-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove bundle2lcp(), bundle2ccp() and bundle2link(). They're too resource-hungry and we have `owner pointers' to do their job. o Make our FSM understand LCPs that are always ST_OPENED (with a minimum code that != 1). o Send FSM code rejects for invalid codes. o Make our bundle fsm_parent deal with multiple links. o Make timer diagnostics pretty and allow access via ~t in `term' mode (not just when logging debug) and `show timers'. Only show timers every second in debug mode, otherwise we get too many diagnostics to be useful (we probably still do). Also, don't restrict ~m in term mode to depend on debug logging. o Rationalise our bundles' phases. o Create struct mp (multilink protocol). This is both an NCP and a type of struct link. It feeds off other NCPs for output, passing fragmented packets into the queues of available datalinks. It also gets PROTO_MP input, reassembles the fragments into ppp frames, and passes them back to the HDLC layer that the fragments were passed from. ** It's not yet possible to enter multilink mode :-( ** o Add `set weight' (requires context) for deciding on a links weighting in multilink mode. Weighting is simplistic (and probably badly implemented) for now. o Remove the function pointers in struct link. They ended up only applying to physical links. o Configure our tun device with an MTU equal to the MRU from struct mp's LCP and a speed equal to the sum of our link speeds. o `show {lcp,ccp,proto}' and `set deflate' now have optional context and use ChooseLink() to decide on which `struct link' to use. This allows behaviour as before when in non-multilink mode, and allows access to the MP logical link in multilink mode. o Ignore reconnect and redial values when in -direct mode and when cleaning up. Always redial when in -ddial or -dedicated mode (unless cleaning up). o Tell our links to `staydown' when we close them due to a signal. o Remove remaining `#ifdef SIGALRM's (ppp doesn't function without alarms). o Don't bother strdup()ing our physical link name. o Various other cosmetic changes. Notes: svn path=/cvs2svn/branches/MP/; revision=35009
| * Make struct bundle into a sort of `struct descriptor'.Brian Somers1998-03-201-1/+2
| | | | | | | | | | | | | | | | It does the fdsets/reads/writes for each of it's datalinks. Notes: svn path=/cvs2svn/branches/MP/; revision=34722
| * Move VJ compression state and stats into struct ipcp.Brian Somers1998-03-161-1/+4
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=34633
| * Move filter sets into struct bundle.Brian Somers1998-03-161-1/+2
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=34631
| * Move the IPCP into struct bundle.Brian Somers1998-03-131-3/+4
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=34557
| * Create struct fsm_parent. FSMs are created with one of these,Brian Somers1998-02-271-2/+2
| | | | | | | | | | | | | | | | | | and the FSM passes subsequent events to them. The datalink now hides its CCP from the bundle layer. Notes: svn path=/cvs2svn/branches/MP/; revision=33858
| * Shuffle around our FSMs a bit. This'll make itBrian Somers1998-02-211-13/+10
| | | | | | | | | | | | | | | | easier to remove the CcpInfo, LcpInfo and IpcpInfo globals. Notes: svn path=/cvs2svn/branches/MP/; revision=33702
| * Rename ccpstate to ccp, ipcpstate to ipcp and lcpstate to lcp.Brian Somers1998-02-081-5/+5
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=33170
| * o Hook the FSMs into our bundle.Brian Somers1998-02-071-45/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o The FSM layering is now more sane. o Move a lot of the NCP stuff into our ipcpstate rather than having it in the bundle, including control of the configured IP addresses. We don't need hacks like the global `linkup' variable any more as the FSM decides when our ppp.link* files get run. This is going to eventually be configurable based on FSM events anyway. o Fix a few inconsistencies when both sides require authentication. o We now have "Ppp..." and "PPp" prompts, reflecting authentication and network phase. We don't print loads of spurious prompts as we change phases any more. o Our phase is part of the bundle now. o Fix a bug where the FSM wasn't calling LayerFinish. o Close the FSM down correctly with a signal rather than slamming it down as if the line was dropped (the undocumented ``down'' command is still available though). o Remove the forgotten `tunno' variable and fix references to it. Notes: svn path=/cvs2svn/branches/MP/; revision=33162
| * Bring the routing seqno into struct bundle.Brian Somers1998-02-021-16/+17
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=33031
| * This commit was manufactured by cvs2svn to create branch 'MP'.cvs2svn1998-01-291-0/+355
| | | | Notes: svn path=/cvs2svn/branches/MP/; revision=32861
* Fix error message.Brian Somers1998-01-241-10/+5
| | | | | | | | Don't complicate the test compilation mentioned at the start of the file. Notes: svn path=/head/; revision=32723
* Stop bogus warnings.Brian Somers1998-01-231-1/+2
| | | | Notes: svn path=/head/; revision=32722
* Re-implement the proxy arp sockaddr_dl search routine (again).Brian Somers1998-01-231-65/+80
| | | | | | | It now works :-) and searches all interface aliases. Notes: svn path=/head/; revision=32721
* Use the sockaddr_dl with the link#, not the ethernet addressBrian Somers1998-01-211-2/+2
| | | | | | | when creating proxy arp entries. Notes: svn path=/head/; revision=32671
* sys/types.h -> sys/param.hBrian Somers1998-01-191-2/+2
| | | | | | | Pointed out by: Niklas Hallqvist <niklas@petra.appli.se> Notes: svn path=/head/; revision=32627
* Reimplement proxy-arp address stuff using sysctl().Brian Somers1998-01-191-83/+117
| | | | Notes: svn path=/head/; revision=32616
* Remove includes of if_var.h and in_var.hBrian Somers1998-01-111-5/+1
| | | | Notes: svn path=/head/; revision=32421
* Cosmetic (style):Brian Somers1997-12-241-7/+7
| | | | | | | | | | sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de> Notes: svn path=/head/; revision=31962
* strncpy(x,y,sizeof(x)) --> strncpy(x,y,sizeof(x)-1)Brian Somers1997-12-231-2/+2
| | | | | | | | Suggested by: Philippe Charnier <charnier@lirmm.fr> Theo de Raadt <deraadt@cvs.openbsd.org> Notes: svn path=/head/; revision=31953
* Fix prototypes.Brian Somers1997-11-221-1/+4
| | | | | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall). Notes: svn path=/head/; revision=31343