summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Fix an issue with ng_tty which (ab)used the tty->t_sc field which isphk2004-09-171-6/+6
| | | | | | reserved for the device drivers: Add a t_lsc field for line discipline private use.
* - Remove advertising clause from copyright [1]glebius2004-09-174-32/+4
| | | | | | - Change my email to glebius@FreeBSD.org Requested by: ru [1]
* A netgraph node implementing Netflow version 5.glebius2004-09-164-0/+1670
| | | | | Supported by: Bestcom ISP, Rinet ISP Approved by: julian (mentor)
* Remove orphaned comment about Meta data.glebius2004-09-111-1/+0
|
* Increase PPTP_MAX_TIMEOUT up to 3 seconds. 10 prooved too much for high packetglebius2004-09-061-1/+1
| | | | | | | | | | loss links, and 1 second appeared to be too small for high latency links. If we will receive more complaints, we should make this parameter configurable. PR: kern/69536 Approved by: archie, julian (mentor) MFC after: 3 days
* In FreeBSD 5.x, curthread is always defined, so we don't need to to testrwatson2004-09-021-3/+3
| | | | | | and optionally use &thread0 if it's NULL. Spotted by: julian
* Acquire Giant arounds calls into the linker from Netgraph sockets.rwatson2004-08-301-0/+2
| | | | | | | | We now no longer hold Giant in send(), so it isn't inheritted by the linker, which calls into VFS. Reported by: glebius Discussed with: glebius, bz
* Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correctrwatson2004-08-281-0/+2
| | | | | | | operation using NET_NEEDS_GIANT(). This will result in a boot-time restoration of Giant-enabled network operation, or run-time warning on dynamic load (applicable only to the Netgraph component). Additional components will likely need to be marked with this in the future.
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-271-1/+1
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* Align netgraph message fields ready for 64-bit (and 128 bit :-) machines.julian2004-08-203-10/+7
| | | | | | | | | | requires a recompile of netgraph users. Also change the size of a field in the bluetooth code that was waiting for the next change that needed recompiles so it could piggyback its way in. Submitted by: jdp, maksim MFC after: 2 days
* Convert ipfw to use PFIL_HOOKS. This is change is transparent to userlandandre2004-08-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and preserves the ipfw ABI. The ipfw core packet inspection and filtering functions have not been changed, only how ipfw is invoked is different. However there are many changes how ipfw is and its add-on's are handled: In general ipfw is now called through the PFIL_HOOKS and most associated magic, that was in ip_input() or ip_output() previously, is now done in ipfw_check_[in|out]() in the ipfw PFIL handler. IPDIVERT is entirely handled within the ipfw PFIL handlers. A packet to be diverted is checked if it is fragmented, if yes, ip_reass() gets in for reassembly. If not, or all fragments arrived and the packet is complete, divert_packet is called directly. For 'tee' no reassembly attempt is made and a copy of the packet is sent to the divert socket unmodified. The original packet continues its way through ip_input/output(). ipfw 'forward' is done via m_tag's. The ipfw PFIL handlers tag the packet with the new destination sockaddr_in. A check if the new destination is a local IP address is made and the m_flags are set appropriately. ip_input() and ip_output() have some more work to do here. For ip_input() the m_flags are checked and a packet for us is directly sent to the 'ours' section for further processing. Destination changes on the input path are only tagged and the 'srcrt' flag to ip_forward() is set to disable destination checks and ICMP replies at this stage. The tag is going to be handled on output. ip_output() again checks for m_flags and the 'ours' tag. If found, the packet will be dropped back to the IP netisr where it is going to be picked up by ip_input() again and the directly sent to the 'ours' section. When only the destination changes, the route's 'dst' is overwritten with the new destination from the forward m_tag. Then it jumps back at the route lookup again and skips the firewall check because it has been marked with M_SKIP_FIREWALL. ipfw 'forward' has to be compiled into the kernel with 'option IPFIREWALL_FORWARD' to enable it. DUMMYNET is entirely handled within the ipfw PFIL handlers. A packet for a dummynet pipe or queue is directly sent to dummynet_io(). Dummynet will then inject it back into ip_input/ip_output() after it has served its time. Dummynet packets are tagged and will continue from the next rule when they hit the ipfw PFIL handlers again after re-injection. BRIDGING and IPFW_ETHER are not changed yet and use ipfw_chk() directly as they did before. Later this will be changed to dedicated ETHER PFIL_HOOKS. More detailed changes to the code: conf/files Add netinet/ip_fw_pfil.c. conf/options Add IPFIREWALL_FORWARD option. modules/ipfw/Makefile Add ip_fw_pfil.c. net/bridge.c Disable PFIL_HOOKS if ipfw for bridging is active. Bridging ipfw is still directly invoked to handle layer2 headers and packets would get a double ipfw when run through PFIL_HOOKS as well. netinet/ip_divert.c Removed divert_clone() function. It is no longer used. netinet/ip_dummynet.[ch] Neither the route 'ro' nor the destination 'dst' need to be stored while in dummynet transit. Structure members and associated macros are removed. netinet/ip_fastfwd.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. netinet/ip_fw.h Removed 'ro' and 'dst' from struct ip_fw_args. netinet/ip_fw2.c (Re)moved some global variables and the module handling. netinet/ip_fw_pfil.c New file containing the ipfw PFIL handlers and module initialization. netinet/ip_input.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. ip_forward() does not longer require the 'next_hop' struct sockaddr_in argument. Disable early checks if 'srcrt' is set. netinet/ip_output.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. netinet/ip_var.h Add ip_reass() as general function. (Used from ipfw PFIL handlers for IPDIVERT.) netinet/raw_ip.c Directly check if ipfw and dummynet control pointers are active. netinet/tcp_input.c Rework the 'ipfw forward' to local code to work with the new way of forward tags. netinet/tcp_sack.c Remove include 'opt_ipfw.h' which is not needed here. sys/mbuf.h Remove m_claim_next() macro which was exclusively for ipfw 'forward' and is no longer needed. Approved by: re (scottl)
* This is the netgraph node framework for the user side call controlharti2004-08-123-0/+1422
| | | | node for ATM. This node implements the API to the signalling services.
* Introduce ng_hci_inquiry_response structure and use it in the hccontrol(8)emax2004-08-101-7/+10
|
* Implement minimalistic L2TP sessions statistics and correct man pagebz2004-08-032-3/+104
| | | | | | | for L2TP tunnel statistics (which do not take an argument sessionID). Reviewed by: archie Approved by: pjd (mentor)
* add a new control message to set sequence numbers on an uninitialized node.bz2004-08-032-2/+79
| | | | | Reviewed by: archie Approved by: pjd (mentor)
* Correct L2TP header offset handling:bz2004-08-031-2/+2
| | | | | | | | | - according to RFC2661 an offset size of 0 is allowed. - when skipping offset padding do not forget to also skip the 2 octets of the offset size field. Reviewed by: archie Approved by: pjd (mentor)
* Do not change link[n].conf.latency for internal usage but havebz2004-08-031-3/+5
| | | | | | | | | link[n].latency calculated from user supplied value. This prevents repeated NGM_PPP_SET_CONFIG/NGM_PPP_GET_CONFIG from failing because of link[n].conf.latency being out of range. Reviewed by: archie Approved by: pjd (mentor)
* Another stupid error from my side. PPPOE_NONSTANDARD was first definedglebius2004-08-011-9/+9
| | | | | | | | in enum {}, and then redefined with #define. No warnings from compiler, though. Submitted by: bz Pointy hat to: glebius
* Fix a stupid error in my previous commit, which broke operationglebius2004-07-311-1/+2
| | | | | | of many nodes. Pointy hat to: glebius
* Address node in a less complex way.glebius2004-07-291-1/+1
| | | | Approved by: julian (mentor)
* Avoid casts as lvalues.kan2004-07-285-10/+14
|
* When making a peer of unknown type framework tries to load moduleglebius2004-07-273-19/+40
| | | | | | | | | | | | | | using linker_load_module(). This works OK if NGM_MKPEER message came from userland and we have process associated with thread. But when NGM_MKPEER was queued because target node was busy, linker_load_module() is called from netisr thread leading to panic. To workaround that we do not load modules by framework, instead ng_socket loads module (if this is required) before sending NGM_MKPEER. However, the race condition between return from NgSendMsg() and actual creation of node still exist and needs to be solved. PR: kern/62789 Approved by: julian
* When node is server serve both standard RFC2516 and non-standard 3Comglebius2004-07-272-44/+119
| | | | | | | | | | clients simultaneously. When node is client its mode is configured with a control message. sysctl net.graph.nonstandard_pppoe is deprecated but kept for backward compatibility for some time. Approved by: julian
* Slight cosmetic changes.julian2004-07-208-37/+54
| | | | | | | | | Also introduce a macro to be called by persistent nodes to signal their persistence during shutdown to hide this mechanism from the node author. Make node flags have a consistent style in naming. Document the change.
* In ng_device_newhook():glebius2004-07-201-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | - Return meaningful return errorcodes. - Free previously allocated connection in error cases. In ng_device_rcvdata(): - Return meaningful return errorcodes. - Detach mbuf from netgraph item, and free the item before doing any other actions that may return from method. - Do not call strange malloc() for buffer. [1] - In case of any error jump to end, where mbuf is freed. In ng_device_disconnect(): - Return meaningful return errorcodes. - Free disconnected connection. style(9) in mentioned above functions: - Remove '/* NGD_DEBUG */', when only one line is ifdef'ed. - Remove extra braces to easier reading. - Add space after comma in function calls. PR: kern/41881 (part) Reviewed by: marks Approved by: julian (mentor)
* 1. Make ng_device.h system include. This fixes module build.glebius2004-07-201-10/+8
| | | | | | | | | 2. Sort includes, while here. 3. s/NULL/0/ in NG_SEND_MSG_HOOK(), since ng_ID_t is integer. PR: kern/41881 (part) Reviewed by: marks Approved by: julian (mentor)
* Reverse a lock/unlock pair that were the wrong way around in some code thatjulian2004-07-181-2/+2
| | | | | | is obviously not run a lot. (but is in some test cases). This code is not usually run because it covers a case that doesn't happen a lot (removing a node that has data traversing it).
* Use qsort_r() instead of qsort() when sorting links by latencyglebius2004-07-161-20/+5
| | | | | | | This helps us to remove a global variable and a mutex protecting it. Reviewed by: rwatson Approved by: julian (mentor)
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-1/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Add a note indicating that the eh_prototype field used to constructrwatson2004-07-141-0/+4
| | | | ethernet headers is unsynchronized.
* Add a mutex ng_tty_mtx to protect the global variable ngt_unit. Noterwatson2004-07-141-0/+10
| | | | | that the locking of globals here isn't complete, and there's also a locking issue relating to calling into and out of the tty code.
* Add ng_ppp_latencies_mtx, a global mutex to protect the latency list.rwatson2004-07-141-0/+11
| | | | | | Note that the table is a hack, and so is this mutex. Reviewed by: glebius
* Introduce a new mutex, ng_fec_mtx, to protect the global unit list torwatson2004-07-141-1/+10
| | | | | | synchronization allocation of FEC unit numbers. Reviewed by: glebius
* Introduce a new mutex, ng_eiface_mtx, to protect the global unit listrwatson2004-07-141-1/+11
| | | | | | | lock used to synchronize allocation of unit numbers for new netgraph ethernet interfaces. Reviewed by: glebius
* Introduce a new mutex, ng_iface_mtx, to protect the global unit listrwatson2004-07-141-1/+12
| | | | | | | | lock used to synchronize allocation of unit numbers for new netgraph interfaces. Reviewed by: glebius Tested by: glebius
* Introduce a global mtx 'ngsocketlist_mtx' to protect the globalrwatson2004-07-121-0/+8
| | | | ng_socket list during insert/delete.
* Mark 'makeup' in ng_frame_relay as const, as its values are immutable.rwatson2004-07-121-1/+1
|
* Update for the KDB framework:marcel2004-07-102-5/+6
| | | | | o Call kdb_enter() instead of Debugger(). o Change comments accordingly.
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-046-17/+17
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Remove the home-grown metadata facility in favour of the now genericjulian2004-06-302-120/+31
| | | | | | mbuf tags facility. Netgraph modules will all need a recompile. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Remove 3rd clause from the licence.marks2004-06-292-4/+0
| | | | Approved by: njl
* MFp4: Last references to dev/usb/usbdevs.h converted.imp2004-06-272-2/+4
|
* Having moved metadata usage to mbuf tags, remove code that supportsjulian2004-06-2612-142/+55
| | | | | | the old way of doing it. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Catch up with usbd_get_string_desc() change.le2004-06-261-1/+1
| | | | Spotted by: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
* Fix line discipline switching issues: If opening a new ldisc fails,phk2004-06-262-19/+3
| | | | | | | | | | | | | we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open. Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen. Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.)
* Not quite sure how that one got past me..julian2004-06-261-1/+1
|
* Add '#include <sys/mbuf.h>' to fix the kernel build.emax2004-06-251-0/+1
|
* oops from Gleb..julian2004-06-251-0/+3
| | | | | | This shouldn't be visible from userland. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Make the frameworkl responsible for not passing the nodes a NULL mbuf pointer.julian2004-06-256-13/+11
| | | | | | this allows the nodes to not test for this.. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Convert Netgraph to use mbuf tags to pass its meta information around.julian2004-06-256-55/+54
| | | | | | | | Thanks to Sam for importing tags in a way that allowed this to be done. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Also allow the sr and ar drivers to create netgraph versions of their modules. Document the change to the ksocket node.
OpenPOWER on IntegriCloud