socketbuffer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 12 Imported by: 0

README

socketbuffer

Sync files between different hosts over a one way network link such as a Data Diode

Test Status Coverage Status

Exports

  • GetReadBuffer: returns the size of the rx buffer
  • GetAvailableBytes: returns the amount of bytes on the listening socket

Works on linux, windows and mac

Go 1.13-1.19

Documentation

Overview

Copyright 2020 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. FROM: https://github.com/prometheus/procfs/blob/master/net_ip_socket.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableBytes

func GetAvailableBytes(rawconn syscall.RawConn) (int, error)

Under linux FIONREAD returns the size of the waiting datagram if one exists and not the total available bytes See: https://manpages.debian.org/bullseye/manpages/udp.7.en.html#FIONREAD Sadly the only way to get the available bytes under linux is through proc/udp

func GetReadBuffer

func GetReadBuffer(rawconn syscall.RawConn) (int, error)

Types

type NetIPSocket

type NetIPSocket []*netIPSocketLine

NetIPSocket represents the contents of /proc/net/{t,u}dp{,6} file without the header.

func NewNetIPSocket

func NewNetIPSocket(file string) (NetIPSocket, error)

Jump to

Keyboard shortcuts

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