Commit Graph

354 Commits

Author SHA1 Message Date
thorpej 4c54445530 Use offsetof() from libkern.h 1998-01-28 02:35:10 +00:00
perry d38a11e380 Fix imported RCS keyword slightly 1998-01-05 05:08:43 +00:00
christos badc0e40aa PR/2733: Bill Sommerfeld: route change command can crash system. Actually
the case mentioned in the PR was fixed as part of PR/2582. There was a similar
case though that was not handled as part of my initial fix, which was fixed
in FreeBSD. I applied the remaining part from FreeBSD and the code matches
now the FreeBSD respective version. [this probably should be pulled up for 1.3]
1997-12-10 00:47:57 +00:00
thorpej 851be78801 Start the watchdog timer in stripopen(), and make sure it's cancelled in
stripclose().  In strip_watchdog(), make abort if the line has been closed.

This fixes kern/4470 (Wolfgang Rupprecht), which was a bad pointer passed
to b_to_q() from strip_proberadio() called via strip_watchdog(); the tty
hadn't yet been attached to the strip interface.
1997-11-20 08:03:06 +00:00
thorpej 7ec7599a61 Change the interface name from "st" to "strip", so as to match the
pseudo-device option listed in the kernel config file, and to avoid
a name clash with the "SCSI tape" driver.
1997-11-17 23:35:28 +00:00
thorpej 22284276e8 Remove a gratuitous debugging printf. 1997-11-17 23:01:44 +00:00
lukem 9e35298d34 * modify ether_aton, ether_hostton, and ether_line to take 'const char *'
arguments as appropriate
1997-11-02 14:26:15 +00:00
mycroft 4666f77376 Do *not* free the mbuf chain we just created. 1997-10-12 16:35:10 +00:00
christos 328602f8d7 Add definitions for bpf_int and bpf_u_int; these are not used in the kernel,
but libpcap expects them if we advertize our current BPF_VERSION.
1997-10-10 14:15:32 +00:00
mrg 74f573d85d remove advertising clause from all my licenses. 1997-10-10 05:39:47 +00:00
christos 6155bdd332 GC bd_sig 1997-10-09 18:58:08 +00:00
christos 485a068ec2 bpf_filter.c:
- update copyright
	- add their rcsid
	- initialize some variables later later for consistency
	  with the current code.
	- change char to u_char to match the current code.
1997-10-09 18:20:04 +00:00
christos 7e9caf0d73 - add their rcsid
- add ifdef to match current code
1997-10-09 18:19:21 +00:00
christos b13f94b5bf sync with bpf-1.2a1
- fix whitespace
	- add rcsid
	- add BPF_RELEASE define
	- add BIOCSTCPF BIOCSUDPF
1997-10-09 18:18:37 +00:00
christos 3108a74999 Sync with bpf-1.2a1
- whitespace
	- add rcsid; our sccsid is newer than the one on 1.2a1.
	- change prototype to add mtu
	- change size_t to u_int for consistency.
	- add alignment stuff in bpf_movein
	- add more consistency checks bpf_movein
	- use one uiomove and then bcopy the data in bpf_movein
	- update the comment for the panic when ifpromisc fails.
	- separate the case when we have non blocking I/O and
	  no data and return EWOULDBLOCK
	- check for other errors and return them
	- pass the mtu to bpf_movein
	- Add the BPF_KERN_FILTER junk, just so that we keep up with the code
	- remove BIOCSRSIG, BIOCGRSIG; SIGIO does this well.
	- don't add the SIOCGIFADDR stuff (it is bogus)
	- Check for malloc return for consistency.
	- comment should say poll
	- change formatting to match the current code.
	- save and restore the pcount and flags in case we fail to set the
	  interface into promiscuous mode.
	- fix spelling typo.
1997-10-09 18:17:19 +00:00
christos 894064be59 - Add some new data link types from libpcap-0.4a3
- bpf_filter() does exist in userland
1997-10-03 16:24:18 +00:00
is fabb33431c Reimplement a test for broadcast addresses advertized, which was left out
when rewriting the ARP system.
1997-10-02 19:41:56 +00:00
matt fe94e79c57 Add SIOC{ADD|DEL}MULTI ioctl to support (for IFF_MULTICAST). 1997-09-25 13:11:58 +00:00
matt 27b993ed37 Add support of SIOCIFMTU to vary mtu of interface. Also allow IFF_MULTICAST
on TUNSIFMODE (sometimes you'd like to do IP multicast on tunnel devices).
1997-09-24 19:45:11 +00:00
mikel a1c1c11a40 eliminate non-comment text after #endifs; from Dave Sainty in PR kern/4091 1997-09-08 02:06:30 +00:00
thorpej ff970dc9c5 Garbage-collect. 1997-08-29 00:57:54 +00:00
thorpej 0eee106cc2 Bring changes from marc-pcmcia branch down to the trunk. 1997-08-29 00:57:28 +00:00
jonathan b327731e26 Add MHLEN + MLEN extra space to LOMTU for IP and transport headers. 1997-08-14 01:12:35 +00:00
phil 511baacef4 Provide better filter validation. PR 3366. 1997-07-07 18:18:28 +00:00
christos d980c28e1d From Paul Mackerras: use sl_compress_setup, not sl_compress_init 1997-06-16 17:01:36 +00:00
christos 6a9f9d3292 PR/3665: Martin Husemann: if_strip calls sl_compress_init with extra arg. 1997-05-24 14:39:44 +00:00
christos cf463415ec Update to ppp-2.3b5 1997-05-17 21:11:59 +00:00
mikel 5f50ab9716 fix bogons; from Jonathan O'Brien in PR kern/3571. 1997-05-07 04:47:15 +00:00
christos 3f5d9dd199 Rename a the pdu fields and don't add the bogus cast on the frmrinfo define. 1997-05-02 21:08:54 +00:00
christos 964a864dac Bring back to life struct frmrinfo and llc_frmrinfo; these are used in netccitt 1997-05-01 23:07:13 +00:00
christos 9dfe73a161 PR/3462: William Studenmund: sizeof(struct llc) returns 10 on m68k instead
of 8. Since structure padding on the m68k is 16 and on the arm is 32, we
rearrange the frmrinfo portion of the union not to contain a second structure.
1997-05-01 14:42:24 +00:00
is f4271c55fd Made pppoutput() public again on behalf of Martin Husemann (PR 3455).
Apparently, the BISDN package uses this function.
1997-04-16 12:54:42 +00:00
chuck cf0f247359 prevent multiple inclusions 1997-04-08 21:29:26 +00:00
christos bd1db9fd84 Fix compile problems (from Veego) 1997-04-03 21:07:42 +00:00
christos 11754cdf41 Update for argument change in at_ifawithnet 1997-04-03 18:48:28 +00:00
christos c5257947c7 PR/3444: Erik Bertelsen: Eliminate warnings when -UINET 1997-04-03 15:25:20 +00:00
christos 0b1d82fb18 Add netatalk stubs. 1997-04-02 21:23:26 +00:00
christos 964633009c Sync with Lite2. 1997-04-02 21:17:28 +00:00
thorpej 0226fc32e4 Don't attempt to include config(8)-generated headers if we're included
by userland.
1997-03-29 19:52:41 +00:00
thorpej 667f747f9a m_copyback() is now in uipc_mbuf.c 1997-03-27 20:38:20 +00:00
thorpej d1c9089a16 Update for the new mbuf code, in a slighly kludgy way. Basically, these
drivers played a somewhat evil trick with clusters, which is now
replaced by a somewhat evil trick with regular malloc'd memory.
1997-03-27 20:36:14 +00:00
thorpej fecae4de60 Back out the previous change (add IFM_10_EXT) after some dicussion
w/ BSDI and Matt Thomas.
1997-03-26 01:19:27 +00:00
christos d465daac1e make sure that the tty layer restarts the ppp layer when there is an error
such as out of buffer space.
1997-03-25 22:33:25 +00:00
jonathan 9a834c4127 Add ARP hardware type for Richochet "starmode" radio addresses. 1997-03-25 02:30:52 +00:00
christos 261ef8aa5a Add missing slpx(); from Bill Sommerfeld 1997-03-24 21:23:10 +00:00
thorpej 6adc9b82fd Add the IFM_10_EXT ("external") ethernet subtype, to accomodate cards
that have the notion of an "external media port".  Suggested by
Matt Thomas <matt@3am-software.com>.
1997-03-24 06:57:31 +00:00
thorpej 4c03c2945d Resolve conflicts from merge. 1997-03-24 00:35:02 +00:00
is 4555777c80 Fix several bugs related to the new ARP code, and ARCnet ARP support.
Among other, add ARPHRD_ARCNET definition, make sure the hardware type is
set on outgoing ARP packets, make sure we dont send out replies as broadcasts.
1997-03-23 01:22:35 +00:00
mycroft 9e9b78f1b5 Don't feed packets to BPF that were not `sent' from the loopback device.
From PR 1693, by Jean-Luc Richier.
1997-03-21 16:58:49 +00:00
is 33d80a37da Deal with AF_ARP on transmission --- without it, the new ARP code doesn't
work.
1997-03-19 16:17:04 +00:00
is 7e9704bb08 Make this compile on port-amiga. Bug report by Bernd Ernesti. 1997-03-17 16:56:34 +00:00
scottr 4cf4807ab0 if_arc.h is in net, not netinet. 1997-03-17 06:45:20 +00:00
thorpej 1b1c7ef868 BSD/OS-style network interface media selection, implemented by
Jonathan Stone and myself.  Many thanks to Matt Thomas for providing
the information necessary to implement this interface, and for helping
to shake out the bugs.
1997-03-17 02:55:12 +00:00
is 57f2f47e2c move if_arc.h to sys/net 1997-03-16 23:27:07 +00:00
cgd 1f5d64db6b s/if_ethertypes.h/ethertypes.h/ because if_ethertypes.h doesn't exist 1997-03-15 21:10:45 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
fvdl 82e4fd7f72 Avoid 'unused variable' warning for copyright string, like in the
previous zlib.c version in the tree.
1997-03-13 20:11:53 +00:00
christos e775167e27 Update to ppp-2.3b4; from Paul Mackerras 1997-03-12 20:26:46 +00:00
chuck cdd09b01c5 minor fix to freebsd section of code from Kenjiro Cho <kjc@csl.sony.co.jp> 1997-03-11 23:19:51 +00:00
mycroft e4bbd86a82 Use splimp() to block interrupts, not splhigh(). 1997-03-04 21:40:07 +00:00
scottr 64d150af76 Avoid duplicate definition of PFIL_HOOKS in the case that the config
file specifies that option.
1997-02-22 17:52:44 +00:00
thorpej cf9c91c5d7 Allow non-superuser to open, listen to, and send safe commands on the
routing socket.  Superuser priviledge is required for all commands
but RTM_GET.
1997-02-22 03:47:01 +00:00
thorpej 60449c1840 Don't let the read timeout get inadvertently rounded down to 0.
From John Hawkinson <jhawk@mit.edu>, PR #2531.
1997-02-21 23:59:35 +00:00
scottr 54b157939d Don't include ipfilter.h if building an LKM. 1997-02-19 23:07:57 +00:00
mrg 4c8bfe2630 pseudo-device ipfilter brings in PFIL_HOOKS. 1997-02-18 20:49:32 +00:00
gwr 77eb8c5a65 fix alignment again for m68k 1997-01-15 18:22:35 +00:00
mikel d235ef1a1c hide softc array and kernel routine prototypes from userland; PR misc/3070 1997-01-03 07:23:29 +00:00
mrg 2cf2442208 remove pfil_bad. 1996-12-20 08:40:46 +00:00
mikel 9aba065e07 add ATM data-link type; reqd. for libpcap. 1996-12-13 07:57:33 +00:00
mycroft f056beb022 Undo silly part of previous change. 1996-12-11 09:37:42 +00:00
chuck df6962b659 fix previous byte-order fix the correct way
(from Zdenek Salvet <salvet@horn.ics.muni.cz>)
1996-11-09 23:02:27 +00:00
cgd 8800178e5c -Wcast-qual cleanups. Don't discard 'const' when casting. 1996-10-25 22:15:54 +00:00
perry 3189406a17 Small fix to make this compile even if no BPFs are being compiled
in. Unfortunately, the BPF-only code called a label that wan't also
being #if'ed, and this made the compiler bitch. Now that we compile
with -Werror, this prevented the thing from compiling at all! (sigh)
1996-10-21 01:58:23 +00:00
chuck 41a87a7ae0 fix: add missing ntohs() for llc mode, as noted by several people including
Dong Lin, Zdenek Salvet, and Matthias Drochner(i think).
1996-10-18 19:26:54 +00:00
christos a1dcf4b026 backout previous kprintf change 1996-10-13 02:10:01 +00:00
christos 10191279fb - printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:59:41 +00:00
mrg 7b71cdec46 minor copyright update. 1996-10-05 23:41:53 +00:00
scottr ae0d4c11cb Use sys/types.h and sys/systm.h to bring in prototypes for bzero() and
bcopy(), instead of string.h
1996-09-18 03:11:03 +00:00
mrg a5f00f16bc move the packet filter hooks in to a saner location. while i'm here, rename
PACKET_FILTER to PFIL_HOOKS.
1996-09-14 14:40:20 +00:00
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
is 905db38340 Add IP multicast support as per RFC 1122 section 3.3.7 to ARCnet.
"The mapping of IP Class D addresses to local addresses is
         currently specified for the following types of networks:
	 [...]
         o    Any network that supports broadcast but not multicast,
              addressing: all IP Class D addresses map to the local
              broadcast address."
1996-09-02 17:28:22 +00:00
mrg c01edc3a02 use sc_unit instead of pointer arthimetic. 1996-08-09 08:34:00 +00:00
jonathan 36c640a447 * Remove old, unused SLIP variables from softc.
* Fix radio error-message parsing bug: old comparison against error
  prefix string  off by the size of the Starmode link-level protocol field.
* Fix radio reset finite state machine, given that parsing works properly.
* Add debugging messages about reset FSM if IFF_DEBUG is set.
* Remove #ifdefs notdef around back the check that discards newlines at
  the beginning of a frame. Every error message from the radio has a newline,
  as the radio send error messages terminated by \r\n, not  just \r like data
  frames. Not dropping the \n garbles the following data frame.
* Remove unused low-level debugging routines.
* Reformat the low-level bytestuff/RLL code to match the canonical source.
* Reduce MTU to 1100 bytes; 1200 bytes can overflow the radio buffers if the
  bytestuff/RLL does poorly.
* Fix radio-probe string to _not_ include a frame delimiter (\r): sending
  a \r to the radio tickles a bug in the firmware, causing the radio to
  smash the next frame sent after  the "**\r" probe string.
* Add calls to the tty t_oproc routine to make sure the probe and reset
  strings get sent to the modem promptly, rather than waiting for the next
  packet.
* Add PPP-style calls to the tty start-output function; seems to
  reduce latency marginally.

still to do:
* Flush output queue if resetting, since the radio is going to drop
  frames on the floor anyway if it needs resetting.
* Reduce tty start-output calls.
1996-08-02 02:53:39 +00:00
cgd ccfab1b072 #ifdef the declaration of 'ac' in fddi_input on ISO, since it's only
used if ISO is defined and -Wall complains.
1996-07-10 18:54:23 +00:00
cgd 1c5ea3c014 print difference between pointers with %ld, so that -Wformat works
on the Alpha and for consistency.  Also, other minor formatting cleanups.
1996-07-10 18:15:22 +00:00
chuck a7d86b86c8 add native mode atm network interrupt 1996-07-04 03:16:13 +00:00
chuck 26cf9de9d5 ported ATM to FreeBSD 2.2-960612-SNAP 1996-07-03 17:17:10 +00:00
christos 0c609bcf9e - Fix PR/2582: default route change without specifying gateway kills system.
While I was there:
- Fix KNF style problem.
- Remove bogus casts to 0, and (caddr_t).
1996-07-01 01:12:32 +00:00
chuck cc499a99d9 change:
- change asock to rxhand and adjust all for this [esp atm_input]
1996-06-29 20:07:05 +00:00
chuck a2efd3b632 add hook for user to turn on/off raw mode 1996-06-28 02:34:34 +00:00
chuck 849f947488 fix/improvement:
- add proto if atm_input
 - add native mode atm hooks to if_atmsubr.c (atm_input)
1996-06-27 04:34:17 +00:00
jonathan d41e338edc * Put in fix to in bytestuffing/RLL code from Stuart Cheshire, that
somehow got lost between NetBSD and Linux.    Output side mbuf-walking
  code now correctly bytestuffs mbuf chains, as well as single mbufs
  and clusters.

* Update radio error-parsing code to Stuart's latest stable code.
  We now parse error messages the older code didn't.

* Note where radio-crash watchdogs should be added (the linux code
  is there, #ifdef'ed out). This still just  doesn't work.
  The radio reset doesn't always work even when slattatch is first started,
  but I have a radio with old firmware, which may be a contributing factor.

* Correct the checks for the tty output queue being overfull;  estimate
  the stuffed pkt size as  (original * 65/64) + STRIP_HDRLEN + 2,
  instead of SLIP's (2*SLMTU).  Re-enable the disabled  check now the
  size estimate isn't excessively large.

* Fix BPF tapping of strip interfaces,  STRIP packets are wrapped
  in a SLIP bpf  header.   This implies no BPF support for arp or atalk,
  even though Linux boxes are sending arp requests and  gratuitous arps.
  There may be no good  fix short  of adding explicit  STRIP encapsulation
  support to bpf/tcpdump.

* Still need a solid walkthrough, and  rewrite to eliminate redundant
  receive-side mbuf copying.
1996-06-26 06:04:20 +00:00
chuck 4ac1ba7fe7 [1] add new rxso passing structure to if_atm.h
[2] modify atm_output to handle native mode atm output mbufs
1996-06-26 04:22:54 +00:00
pk 1a04146533 A couple of emulation enhancements from der mouse's PR#2411:
- ability to be either a BROADCAST or POINTTOPOINT interface.
	- a humble beginning of link-layer addressing (differs from PR
	  by using a `struct sockaddr' instead of single byte).
1996-06-25 22:15:13 +00:00
chuck d9c6fd68b8 network support for ATM networks (ATM == Async Transfer Mode, not
Automatic Teller Machine).

Currently supports PVCs only (no ATM ARP either).
1996-06-22 01:47:35 +00:00
cgd d73abf41aa avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
1996-06-14 22:21:12 +00:00
cgd 1f29d4b51f no need for a local implementation of SIOCGIFMTU; delete it. 1996-06-13 21:50:32 +00:00
cgd ba3b2a87a2 implement SIOCGIFMTU in a generic manner, by pulling the MTU out of
each netif's if_data structure.  There's no point in making each
driver implement this ioctl.
1996-06-13 21:49:43 +00:00
cgd 2e3d795708 add an ifru_mtu member to the union in 'struct ifreq', and add a
#define so that ifr_mtu accesses that.  MTU shouldn't be overloaded
with ifr_metric, if only for clarity.  Adding an MTU field to the
union hurts nothing (in fact, does not actually _change_ generated
code), and does improve clarity.
1996-06-13 21:48:34 +00:00
thorpej 5804211474 Initialize sc_unit in the right place, a'la if_sl.c. Thanks to
Jonathan Stone <jonathan@DSG.Stanford.EDU> for pointing this out.
1996-06-05 23:20:49 +00:00