# NetBSD packet filter

> NetBSD's new stateful packet filter

**Wikidata**: [Q3647640](https://www.wikidata.org/wiki/Q3647640)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/NPF_(firewall))  
**Source**: https://4ort.xyz/entity/netbsd-packet-filter

## Summary
NetBSD packet filter (NPF) is NetBSD's new stateful packet filter, a firewall system that monitors and controls network traffic based on security rules. It is open-source software developed by The NetBSD Foundation, Inc. and written primarily in C with components using yacc and lex.

## Key Facts
- Aliases: NPF, npf.4, npf(4), libnpf, npfctl
- License: BSD licenses
- Sponsor: The NetBSD Foundation, Inc.
- Website: http://www.netbsd.org/~rmind/npf/ and http://rmind.github.io/npf/
- Instance of: firewall, open-source software
- Wikipedia title: NPF (firewall)
- Copyright status: copyrighted
- Operating system: NetBSD
- Programming languages: C, yacc, lex
- Source code repository: https://github.com/rmind/npf
- Wikidata description: NetBSD's new stateful packet filter
- Sitelink count: 6
- Wikipedia languages: English, Persian, Japanese, Georgian, Russian, Turkish

## FAQs
### Q: What is NetBSD packet filter?
A: NetBSD packet filter (NPF) is a stateful packet filter and firewall system developed for the NetBSD operating system. It monitors and controls incoming and outgoing network traffic based on predetermined security rules.

### Q: What programming languages is NPF written in?
A: NPF is primarily written in C, with additional components using yacc and lex for parsing functionality.

### Q: Who sponsors the development of NPF?
A: The NetBSD Foundation, Inc. sponsors the development of NPF as part of the NetBSD project.

## Why It Matters
NetBSD packet filter represents an important advancement in network security for the NetBSD operating system. As a stateful packet filter, NPF provides sophisticated traffic monitoring and control capabilities that are essential for modern network security. Its development by The NetBSD Foundation demonstrates the ongoing commitment to providing robust security tools within the NetBSD ecosystem. The use of open-source licensing under BSD licenses ensures that NPF remains freely available and modifiable by the community, promoting transparency and collaborative improvement. By offering a dedicated firewall solution specifically designed for NetBSD, NPF helps maintain the operating system's reputation for security and reliability in network environments.

## Notable For
- Stateful packet filtering capabilities that track connection states
- Integration with the NetBSD operating system as a native firewall solution
- Open-source development under BSD licenses
- Multi-language support including C, yacc, and lex components
- Active development with source code available on GitHub

## Body
### Development and Architecture
NPF was developed as NetBSD's new stateful packet filter, replacing or supplementing previous firewall solutions within the NetBSD ecosystem. The system is designed to work seamlessly with NetBSD's networking stack and provides both packet filtering and connection tracking capabilities.

### Technical Implementation
The packet filter is implemented primarily in C, with additional components using yacc and lex for parsing configuration files and rules. This combination of programming languages allows for efficient packet processing while maintaining flexibility in rule configuration and management.

### Licensing and Distribution
NPF is distributed under BSD licenses, which permits free use, modification, and distribution of the software. This licensing model aligns with NetBSD's overall philosophy of open-source development and ensures broad accessibility of the firewall technology.

### Community and Support
The NetBSD Foundation, Inc. sponsors NPF's development, providing resources and coordination for the project. The software maintains an active presence on GitHub at https://github.com/rmind/npf, where developers can access source code, submit issues, and contribute to ongoing development efforts.

### Documentation and Resources
NPF is documented through various channels including manual pages (npf.4, npf(4)), library documentation (libnpf, npfctl), and online resources. The project maintains dedicated websites at http://www.netbsd.org/~rmind/npf/ and http://rmind.github.io/npf/ for user guidance and technical information.

## References

1. [Source](http://bxr.su/n/sys/net/npf/npf.h)
2. [Source](http://bxr.su/n/lib/libnpf/npf.h)
3. [Source](http://bxr.su/n/sys/modules/npf/Makefile)
4. [Source](http://bxr.su/n/usr.sbin/npf/npfctl/Makefile)
5. [Source](http://bxr.su/n/usr.sbin/npf/npfctl/npf_parse.y)
6. [Source](http://bxr.su/n/usr.sbin/npf/npfctl/npf_scan.l)
7. [Source](http://bxr.su/n/usr.sbin/npf/npf.7)
8. [Source](http://mail-index.netbsd.org/netbsd-announce/2010/09/13/msg000110.html)