Commit Graph

767 Commits

Author SHA1 Message Date
itojun d300ce3942 add net/if_stf.h and netinet/ip_encap.h (almost noone will include them though) 2000-04-19 06:39:15 +00:00
itojun 3909133548 introduce sys/netinet/ip_encap.c, to dispatch inbound packets
to protocol handlers, based on src/dst (for ip proto #4/41).
see comment in ip_encap.c for details of the problem we have.
there are too many protocol specs for ip proto #4/41.
backward compatibility with MROUTING case is now provided in ip_encap.c.

fix ipip to work with gif (using ip_encap.c).  sorry for breakage.

gif now uses ip_encap.c.

introduce stf pseudo interface (implements 6to4, another IPv6-over-IPv4 code
with ip proto #41).
2000-04-19 06:30:51 +00:00
itojun 5e5941eda1 remove extra memory region kept by "struct pfil_head pfil_head_t;".
it seems totally, unnecessary, or seems to be typo for typedef.
(correct me if i'm wrong)
2000-04-19 04:46:23 +00:00
simonb 450dc64ed8 Remove some routing specific sysctl function declarations from
<sys/sysctl.h> and make them static in net/rtsock.c.
2000-04-15 17:51:27 +00:00
itojun c24f5b5068 add more IPv6 cases. not tested.
TODO: IPv6CP support.  currently IPv6 packet will be generated right
after link up (spec violation)
2000-04-12 10:51:15 +00:00
itojun ecb5f2e56a revisit in6_ifattach().
- be persistent on initializing interfaces, even if there's manually-
  assigned linklocal, multicast/whatever initialization is necessary.
- do not cache mac addr in the kernel.  grab mac addr from existing cards
  (this is important when you swap ethernet cards back and forth)
now ppp6 works just fine!

call in6_ifattach() on ATM PVC interface to assign link-local, using
hardware MAC address as seed.

(the change is in sync with kame tree).
2000-04-12 10:36:38 +00:00
chs 6040f9fa38 remove sunos stuff. 2000-04-12 04:21:22 +00:00
chs b9c0393d3f remove support for sunos and ancient BSDs. 2000-04-12 04:20:47 +00:00
augustss c1ebd1929a Kill some more register declarations. 2000-03-30 09:45:33 +00:00
simonb 76e291abe4 Delete redundant decls of if_slowtimo and if_null{output,input,start,
ioctl,reset,watchdog,drain} - they're in <net/if.h>.
2000-03-30 02:31:59 +00:00
enami 78d601b7d4 Fix typo in comment. 2000-03-29 04:56:47 +00:00
simonb 0fd09c8496 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:33 +00:00
simonb fe30fe7adf Extern etherbroadcastaddr, ether_ipmulticast_min and ether_ipmulticast_max. 2000-03-29 03:36:32 +00:00
simonb 25b33c13f4 Extern the declarations of ifindex2ifnet and if_index. 2000-03-29 03:27:59 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
itojun d4eed1a6bf remove bogus comment 2000-03-22 16:51:03 +00:00
itojun c23a76689e remove if_withname, which was merged in by mistake during KAME merge. 2000-03-22 11:34:15 +00:00
itojun 5f74312bd0 beautify 2000-03-22 11:24:59 +00:00
soren 95054da1a1 Fix doubled 'the's in comments. 2000-03-13 23:52:25 +00:00
itojun dcec402dc9 initialize rn with 0, just to be sure 2000-03-12 11:58:15 +00:00
itojun 8937ddef33 do not touch radix_node with RNF_ROOT on route_output(). this can
cause kernel panic (by non-root invocation of route(8)) on certain
routing table setup.
KAME PR: 217
2000-03-10 14:47:12 +00:00
onoe 85656424da Rename the macro IEEE80211_FC1_RCVFROM_XXX to IEEE80211_FC1_DIR_XXX
and fix the value to be consistent with IEEE 802.11 spec.
The only customer of this macro is if_ray driver for now.
2000-03-10 05:44:23 +00:00
thorpej 57aae5ce02 On second thought, only set a default baudrate for "ethernet" if one
isn't set already.
2000-03-06 21:03:46 +00:00
thorpej b99cf790df - Initialize ifp->if_baudrate to a sensible value when the interface is
attached.
- Add ether_crc32_be() and ether_crc_le(), common functions for computing
  the Ethernet CRC on arbitrary length buffers.  Nothing uses them yet,
  and these should be double-checked and probably re-implemented as
  table-driven functions.
2000-03-06 20:54:41 +00:00
thorpej c2c2f491bc Use the new macros in if.h for setting ifp->if_baudrate. 2000-03-06 20:52:12 +00:00
thorpej 7e0978a583 Initialize ifp->if_baudrate to a sensible value when the interface is
attached.  XXX Need to double-check this one.
2000-03-06 20:51:27 +00:00
thorpej 877704d33e Add ifmedia_baudrate(), which returns a value suitable for ifi_baudrate
given a media word, or 0 for unknown.
2000-03-06 20:50:29 +00:00
thorpej 0f5c059d1f - Add link status to if_data, so that routing daemons and other interested
parties can easily know the state of a link.
- Define an interface announcement message for the routing socket so that
  routing daemons and other interested parties know when an interface
  is attached/detached.
2000-03-06 20:49:00 +00:00
kleink 5d617390f9 Make pre-1.5 compatibility structures being defined conditional on _KERNEL
as well.
2000-03-06 18:55:10 +00:00
soren a4a133213f Add empty token_ifdetach(). 2000-02-27 03:04:09 +00:00
mycroft 6ac2d6c797 For pfil_add_hook(..., PFIL_ALL, ...), if we fail to add the output filter,
make sure to remove the input filter.
2000-02-23 02:35:42 +00:00
darrenr fdf401f582 only call pfil_list_add with one of PFIL_IN or PFIL_OUT defined 2000-02-22 11:30:22 +00:00
darrenr 81069f7a58 return int from pfil_add_hook and pfil_remove_hook to indicate failure
or success, rather than panic'ing
2000-02-22 10:45:47 +00:00
darrenr 4da6dd2324 fix from Mike Pelley to add filters in the reverse order for output
compared with input.
2000-02-22 10:18:49 +00:00
erh 6ac8255360 This is a fragment of the network soft interrupt routine in MD code. DONETISR should be defined to do the appropriate thing for each port before including this. This file is to keep the available NETISRs the same across all ports. 2000-02-21 20:36:14 +00:00
erh fa88d200cf Remove NETISR_IMP. Make NETISR_ARP == AF_ARP, renumber NETISR_PPP to allow this. 2000-02-21 20:31:02 +00:00
darrenr 4b3916780b pass "struct pfil_head *" to pfil_add_hook and pfil_remove hook rather
than "struct protosw *".
2000-02-20 00:56:33 +00:00
sommerfeld a00eb27e1a More 802.11 subtypes: there's also 1MB/s DS
(the BayStack 660 firmware claims to support it).
2000-02-17 21:53:16 +00:00
darrenr fd7edad6c3 Change the use of pfil hooks. There is no longer a single list of all
pfil information, instead, struct protosw now contains a structure
which caontains list heads, etc.  The per-protosw pfil struct is passed
to pfil_hook_get(), along with an in/out flag to get the head of the
relevant filter list.  This has been done for only IPv4 and IPv6, at
present, with these patches only enabling filtering for IPPROTO_IP and
IPPROTO_IPV6, although it is possible to have tcp/udp, etc, dedicated
filters now also.  The ipfilter code has been updated to only filter
IPv4 packets - next major release of ipfilter is required for ipv6.
2000-02-17 10:59:32 +00:00
itojun de10c7425e backout incomplete hack from KAME codebase (originally from bbn).
the hack tries to respect ifa or ifp passed to RTM_ADD.  However, the change
broke certain link-layers.  They include:
- midway ethernet card (en*), which uses sockaddr_dl in gateway portion
  to pass PVC information.  with the patch, the gateway portion will be
  overwritten by empty sockaddr_dl and PVC initialization will fail.
- IPv6, which can't set static ND table with the patch (ndp -s), for the
  similar reason as above.

There may be improved hack coming soon, hope the new one does not break others.
2000-02-17 04:28:00 +00:00
thorpej d87b838524 Fix TMASK to use all 5 lower bits of the media word, and add HomePNA 1.0. 2000-02-16 18:03:14 +00:00
itojun 5d257be455 make assumption in rt_msg1 (len <= MHLEN + MLEN) explicit.
panic if not satisfied.
2000-02-11 06:11:03 +00:00
itojun 541b446bfa for more strict rfc2367 conformance, move netkey/keyv2.h into net/pfkeyv2.h
(net/pfkeyv2.h used to just include netkey/keyv2.h).

netkey/keyv2.h includes #error only for several days, to inform
of file path change.  after that I plan to nuke the file.
2000-02-09 03:27:29 +00:00
thorpej 72ecabeb4d In if_detach(), call PRU_PURGEIF for *every* protocol within a domain
that has a usrreq entry point.  Each protocol may have its own PCB
tables that need to be purged of references to the interface.
2000-02-06 16:43:33 +00:00
itojun 90736ab608 fix include pathname for better rfc2292 compliance. 2000-02-06 12:49:37 +00:00
itojun 1f8497dc18 fix route cleanup on interface removal. (not sure why -Wall did not catch it) 2000-02-05 07:58:54 +00:00
thorpej c1185c1020 PRU_PURGEADDR -> PRU_PURGEIF, per a discussion w/ itojun. In the IPv4
and IPv6 code, also use this to traverse PCB tables, looking for cached
routes referencing the dying ifnet, forcing them to be refreshed.
2000-02-02 23:28:08 +00:00
thorpej 99f19b7139 Wrap a debugging printf in IFAREF_DEBUG. 2000-02-02 18:02:08 +00:00
enami 9cb8699ba1 Revoke bpf device on detach. 2000-02-02 09:03:41 +00:00
enami 983b6de129 Since we are allowed to wait, no need to check the return value. 2000-02-02 08:36:02 +00:00
enami 19bff8f913 Remove duplicated forward declarations. 2000-02-02 07:45:13 +00:00
thorpej d844a3ac41 First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.
2000-02-01 22:52:04 +00:00
thorpej 891a2a9719 Implement bpfdetach(). 2000-01-31 23:06:12 +00:00
enami 6e5c754b80 Set the right ethertype in LLC header for PVC interface.
Pointed by onoe@sm.sony.co.jp
2000-01-28 13:27:29 +00:00
thorpej 3302e4f5a2 Add a way to delete all media for a specified instance. 2000-01-26 21:58:17 +00:00
thorpej 52ee0b9f98 IFM_1000_FX -> IFM_1000_SX, like it's supposed to be, and add a few
more gigabit Ethernet tyes from FreeBSD.
2000-01-25 20:18:52 +00:00
thorpej fe58a40561 Define some convenience information and tables related to ifmedia status
bits for ifconfig(8).
2000-01-25 00:58:59 +00:00
augustss 6d0075dcc2 Fix a typo. 2000-01-24 01:20:21 +00:00
chopps 93d5e38d57 Add beginnings of ieee 802.11 generic stuff 2000-01-23 23:50:13 +00:00
chopps 84d74cfd6d add 802.11 media types 2000-01-23 23:49:48 +00:00
itojun 3867d18179 we don't need IFF_RUNNING for gif. 2000-01-17 06:29:07 +00:00
itojun 2042e749ad for gif interface, sync IFF_RUNNING with IFF_UP. it does not
make sense to leave IFF_RUNNING during !IFF_UP (it is pseudo interface
so we need to immitate - or is it okay if we don't raise IFF_RUNNING?)
2000-01-17 05:50:12 +00:00
itojun b3761abef8 remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec
code, from netbsd-current repository.
#ifdef'ed version is always available from ftp.kame.net.

XXX please do not make too many diff-unfriendly changes, we'll need to take
bunch of diffs on upgrade...
2000-01-06 15:46:07 +00:00
itojun a51908ee11 fix compilation on sun3x.
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
1999-12-22 03:58:12 +00:00
frueauf 176df8913d Make this compile again:
NEWIP6OUTPUT gets no longer defined, revers logic to use OLDIP6OUTPUT.
1999-12-20 20:27:14 +00:00
itojun 0d7c5dfc5a change mbuf trimming.
confirmed that ping -s 1480 (my ip addr) panics before, and works fine now.

possibly fixes PR: 8990
1999-12-15 06:16:05 +00:00
itojun ea861f0183 sync IPv6 part with latest KAME tree. IPsec part is left unmodified
due to massive changes in KAME side.
- IPv6 output goes through nd6_output
- faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator
  using heavily modified DNS servers
- per-interface statistics (required for IPv6 MIB)
- interface autoconfig is revisited
- udp input handling has a big change for mapped address support.
- introduce in4_cksum() for non-overwriting checksumming
- introduce m_pulldown()
- neighbor discovery cleanups/improvements
- netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland)
- IFA_STATS is fixed a bit (not tested)
- and more more more.

TODO:
- cleanup os-independency #ifdef
- avoid rcvif dual use (for IPsec) to help ifdetach

(sorry for jumbo commit, I can't separate this any more...)
1999-12-13 15:17:17 +00:00
itojun 8789e60098 rcsid police 1999-12-02 07:18:44 +00:00
itojun bbb8727584 bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
1999-11-30 13:34:47 +00:00
hannken 2a59794a70 Fix typo introduced in rev. 1.55.
It caused IP6 packets to be sent as AF_UNSPEC instead of AF_INET6.
1999-11-27 18:45:08 +00:00
ragge 7e650509f4 Include param.h instead of types.h, to get mem* macros on vax. 1999-11-19 22:07:12 +00:00
thorpej e1ed9178a1 Add the `packed' attribute to structures which describe wire protocol
data formats.
1999-11-19 20:41:19 +00:00
bouyer f86517a031 Update protocoles and interfaces stats counters to 64bit.
RTM_IFINFO is now 0xf, 0xe is RTM_OIFINFO which returns the old (if_msghdr14)
struct with 32bit counters (binary compat, conditioned on COMPAT_14).
Same for sysctl: node 3 is renamed NET_RT_OIFLIST, NET_RT_IFLIST is now node 4.
Change rt_msg1() to add an mbuf to the mbuf chain instead of just panic()
when the message is larger than MHLEN.
1999-11-19 10:41:41 +00:00
thorpej e19c356e76 Make the ifmedia_entry list a TAILQ. This is pretty much for cosmetics
(media added to tail, so that when e.g. the list is run to print out
what media exist, they appear in-order).
1999-11-03 23:06:35 +00:00
thorpej 98109043a9 Expose the ifmedia_match() function. 1999-10-27 17:59:24 +00:00
itojun 9b2cad3aee avoid unnecessary file inclusion. 1999-10-27 14:14:45 +00:00
wrstuden 2f8d442b6a Up the size of the ifa_flags and ifa_refcnt from shorts to ints. Now will
deal correctly with more than 32767 routes out an interface.

Should close PR 7148 regarding problems when ifs_refcnt overflows.

Bump kernel version from 1.4L to 1.4M.
1999-10-26 22:32:44 +00:00
drochner 87568e8d82 defopt the XNS protocol (options NS), clean up the use of related
option headers / defines
1999-10-25 19:18:10 +00:00
matt 8a762f7db3 Fix appletalk over ethernet. 1999-10-12 04:53:45 +00:00
mrg 755a273d97 pass a pointer to the list, rather than passing a copy of it, when removing
functions from the pfil hook lists.  this fixes the "missing function" problem.
also, re-add support for WAITOK that was lost several deltas ago.
1999-10-10 09:07:32 +00:00
sommerfeld 7e72e96529 Fix PR7946 (neighbor discovery tries to block at interrupt level).
stack-allocate a sockaddr_storage for the temporary sockaddr rather
than putting it in an mbuf.

neighbor discovery wants to delete expired ifa's from a timeout
handler.  allowing rtinit(RTM_DELETE, ...) to run at interrupt level
allows this to work.
i think we can afford the extra ~128 bytes of stack depth ..
1999-10-09 18:55:30 +00:00
erh 622b465872 Delay clearing of RTF_UP until after deleting rt_gwroute. Otherwise, if rt_gwroute is the same as the original route it will get freed twice. It can end up the same because of unusual "route" commands (PR4561) or certain icmp redirects (PR4827). 1999-10-09 08:13:00 +00:00
ad 2399291a41 Define ETHERTYPE_VLAN: IEEE 802.1Q VLAN tagging. 1999-09-29 23:00:21 +00:00
thorpej 6f6f873945 const poison ifunit(). 1999-09-29 22:42:02 +00:00
is f546d949b6 Decouple IP mtu for ARCnet devices from interface MTU.
This is important, because for most protocols, link level fragmentation is
used, but with different default effective MTUs. (e.g.: IPv4 default MTU
is 1500 octets, IPv6 default MTU is 9072 octets).
1999-09-25 17:49:27 +00:00
matt 72a3b3a08a Make NETATALK over FDDI. 1999-09-21 22:18:51 +00:00
matt 590b2a675e Add a ifru_value (unsigned int) as a generic value. 1999-09-21 22:16:24 +00:00
is 6a793d8a47 Zeroth version of IPv6 support for ARCnet. Correct MTU handling still needs
to be done.
1999-09-19 21:31:33 +00:00
is f5050d025a We only need the ether_ipmulticast_min and _max addresses if we have INET
compiled in.
1999-09-15 20:48:19 +00:00
itojun 6b9bfc0691 - Call in{,6}_pcbdetach if ipsec initialization is failed during PRU_ATTACH.
This situation happens on severe memory shortage.  We may need more
  improvements here and there.
- Grab IEEE802 address from IFT_ETHER card, even if the card is
  inserted after bootup time.  Is there any other card that can be
  inserted afterwards?  pcmcia fddi card? :-P
- RFC2373 u bit handling suggests that we SHOULD NOT copy interface id from
  ethernet card to pseudo interface, when ethernet card has IEEE802/EUI64
  with u bit != 0 (this means that IEEE802/EUI64 is not universally unique).
  Do not use such address as, for example, interface id for gif interface.
  (I have such an ethernet card myself)
  This may change interface id for your gif interface.  be careful upgrading
  rc files.

(sync with recent KAME)
1999-09-13 12:15:54 +00:00
itojun 65363da25e Merge in NetBSD/sh3 from cvs.kame.net repository.
Tree structure:
- sys/arch/sh3: sh3 generic code
	As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
1999-09-13 10:30:21 +00:00
is 3e419f86dc Move the mtu initialization to arc_storelladdr, so that it will be upped
again when switching link0 on.
XXX This stuff needs to be thought about, especially with the doomming IPv6
support, which uses yet another default mtu.
1999-08-29 20:38:36 +00:00
is df8d07f87e Don't assume PHDS encoding for DIAGNOSE packets... we have to pass them
raw, if used at all.
1999-08-27 19:38:29 +00:00
is d8c7407afe Factor out arc_storelladdr(), and use that instead of arc_ifattach() in
the bah_reset() function.
This makes the last change work without deconnecting all the other interfaces
from the interface list.
1999-08-27 19:23:19 +00:00
thorpej d4d4f37bca packed -> __packed__ 1999-08-27 01:52:26 +00:00
is 8679b79192 Only use ifp->if_addrlen after initializing it.\
Problem detected by Andreas Johansson.
1999-08-26 20:44:50 +00:00
is c7acd44cf0 Eliminate a function call... we know its exactly one byte here 1999-08-26 19:56:08 +00:00
christos ec608f7058 changes from ppp-2.3.9 [synchronous] 1999-08-25 02:04:05 +00:00
bouyer 075ea2cfea Fix ifa_ifwithnet() for the netatalk case: netatalk uses blocks of addresses
which can't be handled by netmask, and ifa_ifwithnet() didn't find the
interface associated with an adress if it was in the same block but not with
the same prefix. This prevented 'route add' and atalkd to work properly
with some network configs.
This has been discussed on tech-net some weeks ago.
1999-08-24 16:02:27 +00:00
matt d3448593e5 Cleanup a little kludge in mtu handling in route.c. Bring down FDDI
mtu to legal IP max but don't affect other protocols.
1999-08-21 03:46:35 +00:00
thorpej ce3252697d u_char -> u_int8_t in the IPv6 goo. 1999-08-10 18:16:07 +00:00
thorpej 99584ccf61 M_HASCRC -> M_HASFCS, as suggested by Christoph Badura. 1999-08-05 02:07:38 +00:00
thorpej b51de33f23 In ether_input(), if M_HASCRC is set, trim the CRC off the packet. 1999-08-04 19:29:01 +00:00
thorpej 3462650350 Define an Ethernet-specific flag which drivers can use to tell
the input routine that the CRC is included at the end of the frame.
1999-08-04 19:16:48 +00:00
itojun 06c350054d remove reference to in6_systm.h (file itself will be removed afterwords) 1999-07-30 10:35:34 +00:00
bouyer fdb68cb866 Needs cpu.h for netisr (compile breaks on sun3). 1999-07-12 15:03:26 +00:00
thorpej 267920eb1a defopt INET6, and put it in opt_inet.h (most places already include this
file, which is why the file list is so short).
1999-07-09 23:41:16 +00:00
itojun dcc13cdd33 sync with KAME/NetBSD 1.4, SNAP kit 19990705.
key changes are:
- icmp6 redirect fix (dst check)
- revised ip6 multicast check for loopback i/f
- several RCS ID cleanups
1999-07-06 12:23:19 +00:00
kleink 92bd36d9a9 Add namespace protection, using XNS5.2 D2.0 as a reference (which effectively
boils down to not making anything but the if_nameindex(3) interfaces available
to _XOPEN_SOURCE).
1999-07-03 13:52:29 +00:00
itojun 118d2b1d4f IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.
1999-07-01 08:12:45 +00:00
explorer 12b25faeaf KNFify. Add LINK1 flag to turn off that address munging thing, for cases
where the tunnel endpoint is not the same as the remote GRE destination.
1999-06-28 07:52:38 +00:00
itojun 74d3c214ec KAME/NetBSD 1.4 SNAP kit, dated 19990628.
NOTE: this branch (kame) is used just for refernce.  this may not compile
due to multiple reasons.
1999-06-28 06:36:47 +00:00
mrg 1dd8c9f502 call pfil_list_add with the right flag, to ensure it goes into the right list.
from mike@pelley.com in PR#7802.
1999-06-18 05:59:20 +00:00
bouyer cc6eca7553 mbuf should be allocated with M_DONTWAIT in ether_output(). This caused panics
when routing atalk.
1999-06-17 17:27:13 +00:00
bad 6b30aed924 Fix thinko of mine in previous. The source route info is not at m->m_data
after various m_adj()s have been done.  Kludge around this with a cheesy
macro that knows where the drivers put the mac header in the first mbuf.

XXX There should be a better way to do this.
1999-05-30 00:39:07 +00:00
bad 0b3a9f9e00 Don't assume the Token-Ring source route is in the m_pktdat. Use
m_data instead.  This isn't a problem with ARP packets but is correct
way to this.

Noticed by pmara@cactus.org (Shashi Mara).
1999-05-29 22:36:07 +00:00
tron 770a66b9a8 Fix kernel builds if ppp interface but no bpf filters are configured.
Patch supplied by Takahiro Kambe in PR kern/7639, also fixes PR kern/7632
by Bjoern Labitzke.
1999-05-24 20:12:10 +00:00
augustss b1800a623c Make this file syntactically correct again. 1999-05-21 00:25:48 +00:00
tsarna 25e3ee0ff2 Add a *bunch* of types (file went from ~4K to ~16K!) 1999-05-20 21:02:43 +00:00
thorpej 3da4443954 Oops, commit here slipped through the cracks. 1999-05-20 18:07:27 +00:00
thorpej f98d358a1f Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
1999-05-18 23:52:51 +00:00
tron 81897066b9 Fix compilation problem caused by recent changes to filtering code. 1999-05-14 21:33:41 +00:00
thorpej 7e3a0bf0c5 Decouple inbound and outbound filters. Now instead of using "active-filter"
and "pass-filter" and "inbound" and "outbound" qualifiers in the filter
expression, use new "active-filter-in", "active-filter-out", "pass-filter-in",
and "pass-filter-out" without these qualifiers.

This is necessary due to the horrible, awful way "inbound" and "outbound"
were specified for the filter programs when a packet was passed through them.
Basically, the "address" byte in the serial PPP header was overwritten with
a value to indicate the direction.  However, the "address" byte doesn't even
exist on PPP headers for all other PPP encaps!  So, this old method worked
only for serial encaps, and corrupted packets for all others (PPPoE, ATM, etc.)
1999-05-12 18:50:51 +00:00
thorpej 4c89a367d5 * Start out with a data link type of DLT_NULL. When we change an interface
to serial encap, change its data link type to DLT_PPP_SERIAL.
* Work around some serious bogosity in the filtering code which utterly
breaks proper functioning of BPF.  The PPP code and pppd(8) WILL be changed
to fix this.
1999-05-11 02:18:52 +00:00
thorpej c806cc5a47 * Add the ability to change the data link type on the fly.
* Define two more data link types: NetBSD PPP-over-serial and NetBSD
PPP-over-Ethernet.  (Different PPP encaps have different header formats!)
1999-05-11 02:11:08 +00:00
matt e3107a86c2 Add ARP hardware type for IEEE 1394 (FireWire) 1999-05-08 01:42:24 +00:00
thorpej c7ea24c151 Back out previous. It was just ... braindamaged. 1999-04-30 17:47:36 +00:00
abs 175b821dfe If the driver only supports one media type, and ifmedia_ioctl() is called to
select the current medium, (and it is not autoselect), assume no change and
do not try to select the medium. Fixes 'ifconfig le0 medium 10base5' on sparc2
without requiring a 'do nothing' mediachange callback.
1999-04-30 17:30:49 +00:00
drochner b86fdd7409 don't expose structures and prototypes to _STANDALONE programs 1999-04-09 09:32:51 +00:00
bad 6bdc01f098 Fix version id strings in comment. 1999-04-08 15:53:31 +00:00
explorer 9350aaaee9 Add NetBSD rcsid tags, and preserve old ones from i4b source 1999-04-04 06:57:03 +00:00
explorer 6249482be9 Install if_sppp.h in include/net/ 1999-04-04 06:08:40 +00:00
explorer a6a18662a2 switch to the i4b version of if_sppp*.[ch] (with mods) 1999-04-04 06:07:56 +00:00
chopps 0723de9c6c deal with failure of malloc NOWAIT by restarting after mallocing with WAIT.
don't write beyond the users given buffer size (this happened if there was
	enough space for the initial malloc to succeed).
1999-04-02 17:22:21 +00:00
kleink 22ac9f8845 ANSI C police. 1999-03-28 17:13:47 +00:00
dbj a6f0126b1a fixes to compile if NBPFILTER == 0 1999-03-27 22:48:36 +00:00
aidan da1b3a7abf Added per-addr input/output statistics. Currently just support netatalk
and netinet, currently only tested under netinet.

Disabled by default, enabled by compiling the kernel with option
IFA_STATS.  Enabling this feature seems to make the ip_output function
take 13% longer than before, which should be OK for people that need
this feature.
1999-03-27 01:24:49 +00:00
thorpej 9da505740a Define several constants related to the Ethernet protocol:
- ETHER_ADDR_LEN: length of Ethernet address (actually, we already defined
  this).
- ETHER_TYPE_LEN: length of the Ethernet header `type' field.
- ETHER_CRC_LEN: length of the Ethernet CRC (explorer got this already, mostly
because I forgot to commit these changes earlier).
- ETHER_HDR_LEN: total length of the Ethernet header
- ETHER_MAX_LEN: maximum length of an Ethernet frame, including header and CRC
- ETHER_MIN_LEN: minimum length of an Ethernet frame, including header and CRC

Define ETHERMTU and ETHERMIN (payload sizes) in terms of the above constants.
1999-03-25 23:08:28 +00:00
explorer f388d47b3b put RCS ids in the right place. And yes, this is a SYNC ppp interface,
used for high-speed (T1, HSSI, DS3) interfaces.
1999-03-25 05:25:42 +00:00
explorer eb94e6147c define ETHER_CRC_LEN, for if_vr.c 1999-03-25 04:45:37 +00:00
explorer 2a91ea8a57 port FreeBSD's serial ppp layer to NetBSD. The PPP part seems broken still,
but the lmc driver uses the HDLC bits from here anyway.
1999-03-25 03:38:00 +00:00
tron bbee1b42b1 Make it possible to set MTU via "ifconfig" at run time. "SLMTU" is now
used to set the initial value.
1999-03-25 00:52:14 +00:00
thorpej 86f87d7c5f Add a new shared media option, IFM_FLOW, used to enable link-level
flow control.  IEEE 802.3x is in mind, but this could be generally
useful for different types of media.
1999-03-23 21:46:47 +00:00
bad 8bb131360c Appease GCC.
#ifdef FreeBSD some debug code as is done if if_fddisubr.c.
1999-03-22 23:14:14 +00:00
bad a4e508928f Oops. RcsID police. 1999-03-22 23:01:36 +00:00
bad b6163c625a Add LLC_SNAPFRAMELEN. 1999-03-22 22:29:27 +00:00
bad ab3f3172c5 Add ARPHRD_IEEE802. 1999-03-22 22:28:40 +00:00
bad 76c3e33738 Add if_token.h to INCS. 1999-03-22 22:27:41 +00:00
bad 52c3a56a05 Support routines for Token-Ring network drivers.
By Onno van der Linden.
1999-03-22 22:22:52 +00:00
thorpej 49d0b5de2b Define the PPPoE Discovery and PPPoE ethertypes. 1999-03-20 03:37:52 +00:00
drochner 98294086d9 make this compile again 1999-03-13 14:09:46 +00:00
perry d446fb449c exterminate ovbcopy. patches provided by Erik Bertelsen, pr-7145 1999-03-12 22:42:30 +00:00
thorpej 5fa25527ac Const poison ether_ifattach(). 1999-03-10 21:05:08 +00:00
thorpej f48012dee8 Const poison ether_sprintf(). 1999-03-10 03:28:50 +00:00
mjacob d7e48cb804 adjust format args for compiler changes 1999-03-04 02:38:31 +00:00
is 06420a5af7 So... after all, the ATA878.2 copy I had was buggy. The newer revision has
this fixed in the figures (but still not in the text); anyway, the intention
of the ATA is that this is identical to the PHDS specification.
Remove the ...EXC_8782 constant, and change the _EXC_1201 constant to be
a simple ...EXC.
1999-02-25 11:20:34 +00:00
is 874801e906 Remove zero length array 1999-02-23 20:11:06 +00:00
kleink cd577c539a Addendum to rev. 1.15: use of __extension__ here is supported in GCC 2.8.0 and
above only; since this is the only occurence, fix it locally rather than in
<sys/cdefs.h> as to not remove all the functionality on pre-2.8 systems.
XXX Shouldn't use zero-length arrays at all.
1999-02-23 16:59:38 +00:00
kleink 10a02a6706 Zero-sized arrays are a GNU C extension; from Dave Sainty in PR kern/6271. 1999-02-21 17:35:17 +00:00
hubertf 56f2d188fc RCS ID police 1999-02-15 04:54:34 +00:00
hwr fbd6e613b3 We no longer support IPIP (IP proto 4). 1999-01-26 21:21:14 +00:00
msaitoh 3af083d212 fix "CMSA CD" to "CSMA/CD" 1999-01-18 06:31:13 +00:00
is 5854b4eafe Yet another performance optimization for exceptional length ARCnet packets.
This time in the receive path.
1999-01-16 14:08:05 +00:00
is f77decf65c Make the code path for exceptional length packets a bit faster (2 mbuf
operations less) and better readable.
1999-01-16 13:04:13 +00:00
is 0a3d4d8915 - define protocol type for diagnostics (0x80 as per ANSI 878.1)
- define protocol type for IP version 6
- define length of exceptional length packets for both RFC 1201-style and
  ATA 878.2-style fragmentation.
1999-01-16 13:01:20 +00:00
thorpej 6ae68b4feb Pull the IP-in-IP tunneling support out of the GRE code. It's not handled
by a separate IP-IP input path.

XXX Should eventually do the same thing for IPPROTO_MOBILE.
1999-01-11 21:32:13 +00:00
thorpej d70bb64a38 Use M_LINK{0,1} for our own mbuf flags, rather than arbitrarily picking
2 bits.
1999-01-09 21:47:09 +00:00
thorpej f079e8d39c Simplify the rttimer code somewhat; use TAILQs instead of CIRCLEQs (we
didn't really need to traverse the queues backwards anyhow), and other
minor code simplification.
1998-12-27 18:27:48 +00:00
veego 50cc03465e Fix kern/6658 from Martin Husemann:
After booting a current kernel and receiving a few arp requests on the
network it panics (data modified on free list). The panic message is wrong,
as code inspection shows the memory pool for routing entries is intialized
twice, while the routing timer memory pool is never initialized.
1998-12-27 11:44:41 +00:00
thorpej 0a87ec1ac7 Use pools for rtentry and rttimer structures. 1998-12-22 02:27:06 +00:00
thorpej 3322b9a32e Add an extern declaration of gre_softc[] here. Wrap it and the prototypes
in #ifdef _KERNEL.
1998-12-22 01:33:45 +00:00
christos bdaefe06f3 Synchronize with the Ultrix version of the ppp release. 1998-12-12 18:22:39 +00:00
christos a0823f0a89 #include "opt_ppp.h" otherwise struct ppp_softc can be the wrong size
(From mycroft)
1998-12-12 18:21:32 +00:00
christos c748ecf74a fix thinko in previous change. 1998-12-12 17:26:09 +00:00
christos 52f565dcfd Revert IPX changes that I committed accidentally. 1998-12-10 17:48:40 +00:00
christos 13d58281de IPX counters and centralize statistics routine. 1998-12-10 15:52:39 +00:00
christos e856516838 IPX fixes. 1998-12-10 15:51:48 +00:00
christos 7e5316ae6e IPX fixes. 1998-12-10 15:50:54 +00:00
christos bf10ca4eff linted comment 1998-12-10 15:11:05 +00:00
christos bee9dafdf5 defopt COMPAT_43 1998-12-10 15:07:01 +00:00
christos c7578c510a defopt 1998-12-10 11:01:01 +00:00
bouyer 433c02431e Init the decriptors at boot time rather than at interface attach time.
Now that we have pcmcia hot-plug, it's not the same. Fixes kern/3189.
1998-12-04 11:04:37 +00:00
sommerfe 14dc6ddfe6 Fix PR6473: allow sends to tun* devices using bpf. 1998-11-30 21:43:11 +00:00
jonathan fb020850a0 Increase compiled-in default bpf buffer size from 4096 to 8192.
(the libpcap API provides no way to resize the inkernel buffe,r and
4096 is too small to capture maximum-sized FDDI frames.)
1998-11-05 22:50:15 +00:00
thorpej be4ce8c3f4 Add "10baseT-FDX" and "100baseTX-FDX" aliases to the end of the subtype
table.  These are actually subtype+option combos, but these are the
strings displayed by the MII code to indicate 10Mbps full-duplex and
100Mbps full-duplex respectively, and it's Nice that ifconfig(8) can
grok them.
1998-11-02 22:10:26 +00:00
kml afd8d9361f Add call to splsoftnet() in rt_timer_timer to avoid possible race
condition in deleting timer queue (PMTU) entries.
1998-10-28 05:01:11 +00:00
kim e34aa44c14 Put back ETHERTALK_AT (but I did convert *all* code to ETHERTYPE_ATALK),
so if vendors (or something) used it, it is still found.  Also added short
comments for each alias to explain why they are there.
1998-10-13 02:55:18 +00:00
kim cd7e3136ad Use ETHERTYPE_ATALK instead of ETHERTYPE_AT. The former seems more common.
Our other constants also use "ATALK".

Added many new ETHERTYPE constants to sys/net/ethertypes.h, including the
ones from libpcap and tcpdump "ethertype.h" files.
1998-10-13 02:34:31 +00:00
thorpej 588ccb2d75 Fix some typos in comments, and clean up some whitespace. 1998-10-07 23:33:02 +00:00
kleink 44b31a4395 Use #error instead of causing parse errors; noticed by Heiko. 1998-10-06 18:38:08 +00:00
hwr 0959469679 Also install if_gre.h in /usr/include/net/ 1998-10-02 19:23:55 +00:00
hwr eaccb9cd8d Start supporting IPPROTO_MOBILE (55) encapsulation. This is yet
another tunneling protocol used by the Mobile-IP people. See RFC 2004
for this.
1998-09-30 05:59:27 +00:00
matt 08e1d890a4 Changes so that BPF readers will get the data in fddi packet aligned along
normal boundaries.  This makes tcpdump much happier.
1998-09-20 02:36:08 +00:00
hwr 6831c842f3 The post 1.3.2 world is actually ready for this. 1998-09-13 21:39:49 +00:00
hwr 366b9c4515 Add a gre tunnel pseudo network device. Gre = generic route encapsulation.
This device shows up like any other network interface and can be used to
tunnel L3 protocols as e.g. IP over IP.
1998-09-13 20:27:47 +00:00
thorpej 78f9387863 Add/move some Ethertypes, PR #5997, Heiko W.Rupp. 1998-09-09 04:32:39 +00:00
christos 564a4c75d0 PR/5414: Ronald Khoo: tcpdump ppp does not respect inbound/outbound qualifiers. 1998-09-03 14:12:36 +00:00
enami 27d8639238 Make this compile with -DIFMEDIA_DEBUG. 1998-08-30 07:39:39 +00:00
mrg a317393b79 use __NetBSD__ not NetBSD 1998-08-26 15:12:55 +00:00
thorpej 2cffea3962 Use do { ... } while (0) in RTFREE(). 1998-08-25 04:22:33 +00:00
veego ff2c3adddc Add some braces to stop the new egcs warnings. 1998-08-20 19:55:06 +00:00
thorpej 7cc905f5c8 Add some braces to make egcs happy (ambiguous else warning). 1998-08-18 06:27:01 +00:00
thorpej 06b7eb9001 Explicitly dereference the route timer expiration function pointer. 1998-08-15 03:17:21 +00:00
thorpej 798cb235bc Oops, I forgot aliases for some old names (10baseT/UTP, 10base2/BNC,
and 10base5/AUI).
1998-08-12 23:23:29 +00:00
thorpej f996a2e194 Define IFM_INST_MAX, the largest possible "instance" value. 1998-08-08 22:12:30 +00:00
thorpej ddb9746a51 Define the minimum and maximum "network type" values. These values are
incremented by the minimum to interate through them.
1998-08-06 19:16:37 +00:00
perry b84f472652 Sigh. "consts in prototypes can be quite a drag..."
fix last two fixes one more time, this time dealing with ugly
prototype issues, including the fact that the bcopy returns nothing,
but memcpy returns a void *. Never mind that we don't use it...
1998-08-06 04:37:57 +00:00
perry 9f63941cfa Fix botched prototype decl in last fix. 1998-08-06 04:25:55 +00:00
perry df410f33db Convert bcopy,bzero to memcpy,memset
This was semi-nontrivial, since a function pointer to bcopy gets used
in this file.
Note #1: The catchpacket routine, which takes a function pointer to
         bpf_mcpy or memcpy, should probably be converted to take a
         flag that just says which is used, so memcpy can be inlined.
Note #2: The code is heavily #ifdef'ed to run on older operating
         systems. We probably want to clean that cruft out, unless
         someone is planning a new release of the code at LBL (doubtful.)
1998-08-06 04:24:25 +00:00
thorpej dd588c0660 Add a macro to create a media word from type, subtype, options, and instance. 1998-08-06 02:38:19 +00:00
thorpej b04ded7264 Completely rewrite the way media descriptions are represented. The same
data structure is used, but a much saner matching mechanism is used, one
which allows greater ease in adding new types.
1998-08-06 02:19:34 +00:00
thorpej 1b58f59205 Add IFM_10_FL - 10baseFL (fiber) 1998-08-03 12:42:26 +00:00
sommerfe 6ee9772e54 Fix PR5898: ppp delays last packet. 1998-08-02 15:09:50 +00:00
is a276ff33bc Remove obsolete comment. 1998-07-28 12:25:53 +00:00
explorer d83ea88a76 define DLT_HDLC 1998-07-25 11:31:18 +00:00
thorpej e552760fbe Glue in fast forwarding. 1998-07-09 22:30:01 +00:00
sommerfe 3858a1179a Only run pppasyncstart (sc->sc_start) from the netisr handler.
This allows pppoutput to be called from splimp (e.g., when ipflow is
in use.) without requiring pppasyncstart to run at splimp.
This is believed to fix PR5624.
1998-07-08 18:05:48 +00:00
thorpej 9ab51d2224 Make this compile again. 1998-07-07 03:22:03 +00:00
jtk 14119e2944 use #ifdef INET so this compiles again 1998-07-06 13:51:32 +00:00
jonathan b37021c1a1 defopt NATM. 1998-07-05 22:48:05 +00:00
jonathan 011f2bda08 defopt NS, NSIP. 1998-07-05 06:49:00 +00:00
jonathan 5c0c5dd0b4 defopt ISO TPIP. 1998-07-05 04:37:35 +00:00
jonathan fe484937cf defopt LLC 1998-07-05 03:14:41 +00:00
jonathan 8db0fcdbf7 defopt CCITT. 1998-07-05 02:12:22 +00:00
jonathan 3751946b97 defopt INET, NETATALK. 1998-07-05 00:51:04 +00:00
thorpej 816e12eac2 defopt COMPAT_SVR4 1998-06-26 00:07:06 +00:00
thorpej c466f11939 defopt COMPAT_LINUX 1998-06-25 23:18:23 +00:00
cgd 651b44e211 Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install.  (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.)  The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change.  Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
1998-06-12 23:22:30 +00:00
kleink 3ecb81dc87 Sync the symbol used for multiple inclusion protection with the canonical
location of this header.
1998-05-29 13:37:39 +00:00
matt b2c24dbcbe Add an if_drain to the ifnet structure (call when the system is low
on mbufs).  Add code to m_reclaim to call if_drain in each ifnet
that has one set.  Remove register from declarations.
1998-05-22 17:47:21 +00:00
kml 051be14326 Correct copyright date. 1998-05-17 16:46:06 +00:00
thorpej ff4919623e Add missing RCS ID. 1998-05-16 00:49:45 +00:00
kml e72782a137 Driver for Essential Communications' RoadRunner HIPPI (800 Mb/sec network)
card.  With some modification, this could probably also work for their
Gigabit Ethernet card based on the same chipset...
1998-05-14 00:04:57 +00:00
drochner 63cecf5737 This comment is not true. 1998-05-06 18:23:34 +00:00
bouyer de584a5245 Make ATM_LLC_SETTYPE do the rigth thing: swap byte on LE machines,
don't swap on BE machines. The previous revision required a ntohs()
in atm_output(), to work on LE machines. This was broken for BE machines.
1998-05-06 10:16:04 +00:00
christos f648c916d5 Add IPX bits. 1998-05-04 12:54:22 +00:00
thorpej 5e7c21d896 Need <sys/socket.h> to stand alone. 1998-05-02 21:19:03 +00:00
christos 0f39feb773 Merge changes from pppd-2.3.4; adds ppp-deflate-draft stuff and updates
zlib. Maybe we can merge our other copy of zlib with this one now and
avoid having two copies?
1998-05-02 14:34:24 +00:00
thorpej 4c5d87fd09 Squash a typo. 1998-05-01 03:58:55 +00:00
thorpej 2fdee596a3 Glue in IP flow fast forwarding. 1998-05-01 03:50:59 +00:00
thorpej 7e223b244a Add FDDI source address spoofing via pseudo_AF_HDRCMPLT. 1998-05-01 03:44:52 +00:00
thorpej 27dba7b8e8 Implement two new BPF ioctls: BPFGHDRCMPLT and BPFSHDRCMPLT, to get/set
the "header already complete" flag.  This allows BPF writers to spoof
layer 2 source addresses (providing the layer 2 in use supports it) in
applications where this is necessary.  From Greg Smith <greg@nas.nasa.gov>.
1998-04-30 00:08:19 +00:00
thorpej 5e5904eb39 In ether_output(), if the socket address family is pseudo_AF_HDRCMPLT,
use the Ethernet source address speficied in the sockaddr rather than
the interface's Ethernet address, and then fall through to the AF_UNSPEC
case.  From Greg Smith <greg@nas.nasa.gov>.
1998-04-30 00:05:41 +00:00
matt d4d709f7d0 Add support for "fast" forwarding. Add hooks in if_ethersubr.c and
if_fddisubr.c to fastpath IP forwarding.  If ip_forward successfully
forwards a packet, it will create a cache (ipflow) entry.  ether_input
and fddi_input will first call ipflow_fastforward with the received
packet and if the packet passes enough tests, it will be forwarded (the
ttl is decremented and the cksum is adjusted incrementally).
1998-04-29 21:37:52 +00:00
thorpej 93b075a492 Oops, we depend on <sys/queue.h>. 1998-04-29 17:49:58 +00:00
kml 8cdafd0efb Add generic route timeout functionality; used by path MTU discovery code 1998-04-29 03:41:49 +00:00
mrg 816ca00ce0 remove some register. 1998-04-26 06:17:20 +00:00
bouyer 287667ba9a Fix my previous commit: the ATM_LLC_* macros do the ntoh/hton conversion,
so the bug was not a missing ntohs in atm_input(), it was an extraneous
htons in atm_output().
1998-04-15 13:01:51 +00:00
bouyer 3d92d64171 Add a missing ntohs. With this change I got ip over atm (vpi/vci) working
between 2 PCs.
1998-03-24 18:48:59 +00:00
kleink 56ddd74138 register -> register int 1998-03-24 12:57:15 +00:00