From ada0e6f0188ef8c2119d64136cdda4df0938d63d Mon Sep 17 00:00:00 2001 From: Will Scott Date: Sun, 8 Mar 2020 18:22:39 -0700 Subject: [PATCH] transition to Libp2p --- LICENSE | 29 +++++++++++++++++++++++++++++ README.md | 45 +++++++++++++++++++++++++++++++++++++++------ go.mod | 2 +- 3 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..58f513f --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index f3eec21..34821aa 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,35 @@ Go Netroute === -[![Build Status](https://travis-ci.com/willscott/go-netroute.svg?branch=master)](https://travis-ci.com/willscott/go-netroute) +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai) +[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://github.com/libp2p/libp2p) +[![Build Status](https://travis-ci.com/libp2p/go-netroute.svg?branch=master)](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) diff --git a/go.mod b/go.mod index 1b1d922..9d687a3 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/willscott/go-netroute +module github.com/libp2p/go-netroute go 1.13