mirror of
https://github.com/netbirdio/go-netroute.git
synced 2026-05-22 17:11:07 -07:00
transition to Libp2p
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
Copyright (c) 2020 Will Scott. All rights reserved.
|
||||
Copyright (c) 2012 Google, Inc. All rights reserved.
|
||||
Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Andreas Krennmair, Google, nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,19 +1,35 @@
|
||||
Go Netroute
|
||||
===
|
||||
|
||||
[](https://travis-ci.com/willscott/go-netroute)
|
||||
[](http://protocol.ai)
|
||||
[](http://github.com/libp2p/libp2p)
|
||||
[](https://travis-ci.com/libp2p/go-netroute)
|
||||
|
||||
A cross-platform implementation of the [`gopacket/routing.Router`](https://godoc.org/github.com/google/gopacket/routing#Router) interface.
|
||||
|
||||
This library uses `gopacket` for linux, `x/net/route`
|
||||
for mac, and `iphlpapi.dll` for windows.
|
||||
This library is derived from `gopacket` for linux, `x/net/route` for mac, and `iphlpapi.dll` for windows.
|
||||
|
||||
Usage
|
||||
---
|
||||
## Table of Contents
|
||||
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [Documentation](#documentation)
|
||||
- [Contribute](#contribute)
|
||||
- [License](#license)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
go get github.com/libp2p/go-netroute
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
To be used for querying the local OS routing table.
|
||||
|
||||
```
|
||||
import (
|
||||
netroute "github.com/willscott/go-netroute"
|
||||
netroute "github.com/libp2p/go-netroute"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -25,3 +41,20 @@ func main() {
|
||||
fmt.Printf("%v, %v, %v, %v\n", iface, gw, src, err)
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
See the [gopacket](https://github.com/google/gopacket/blob/master/routing/) interface for thoughts on design,
|
||||
and [godoc](https://godoc.org/github.com/libp2p/go-netroute) for API documentation.
|
||||
|
||||
## Contribute
|
||||
|
||||
Contributions welcome. Please check out [the issues](https://github.com/libp2p/go-netroute/issues).
|
||||
|
||||
Check out our [contributing document](https://github.com/libp2p/community/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
|
||||
|
||||
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
|
||||
|
||||
## License
|
||||
|
||||
[BSD](LICENSE) © Will Scott, and the Gopacket authors (i.e. Google)
|
||||
|
||||
Reference in New Issue
Block a user