network

package
v1.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

PulseHA - HA Cluster Daemon Copyright (C) 2017-2020 Andrew Zak <andrew@linux.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArpScan

func ArpScan(addrWSubnet string) string

* Function to perform an arp scan on the network. This will allow us to see which IP's are available.

func BringIPdown

func BringIPdown(iface, ip string) error

* This function is to bring down a network interface

func BringIPup

func BringIPup(iface, ip string) error

* This function is to bring up a network interface

func CheckIfIPExists

func CheckIfIPExists(ipAddr string) (bool, string, error)

* Checks to see if an IP exists on an interface already

func Curl

func Curl(httpRequestURL string) bool

* Perform a curl request to a web host. This only returns a boolean based off the http status code received by the request.

func GetInterfaceNames

func GetInterfaceNames() []string

* Return network interface names

func ICMPv4

func ICMPv4(Ipv4Addr string) bool

*

func IPv6NDP

func IPv6NDP(ipv6Iface string) string

* Send the eq. of IPv4 arping with IPv6

func InterfaceExist

func InterfaceExist(name string) (bool, netlink.Link)

* Check if an interface exists on the local node

func SendGARP

func SendGARP(iface, ip string) bool

* Send Gratuitous ARP to automagically tell the router who has the new floating IP NOTE: This function assumes the OS is LINUX and has "arping" installed.

Types

type ICMPv6MessageHeader

type ICMPv6MessageHeader struct {
	Type     byte
	Code     byte
	Checksum uint16
}

type ICMPv6NeighborSolicitation

type ICMPv6NeighborSolicitation struct {
	Header            ICMPv6MessageHeader
	Reserved          uint32
	TargetAddress     [16]byte
	OptionType        byte
	OptionLength      byte
	SourceLinkAddress [6]byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL