github.com/noisysockets/noisysockets@v0.21.2-0.20240515114641-7f467e651c90/internal/conn/gso_default.go (about)

     1  //go:build !linux
     2  
     3  // SPDX-License-Identifier: MPL-2.0
     4  /*
     5   * Copyright (C) 2024 The Noisy Sockets Authors.
     6   *
     7   * This Source Code Form is subject to the terms of the Mozilla Public
     8   * License, v. 2.0. If a copy of the MPL was not distributed with this
     9   * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    10   *
    11   * Portions of this file are based on code originally from wireguard-go,
    12   *
    13   * Copyright (C) 2017-2023 WireGuard LLC. All Rights Reserved.
    14   *
    15   * Permission is hereby granted, free of charge, to any person obtaining a copy of
    16   * this software and associated documentation files (the "Software"), to deal in
    17   * the Software without restriction, including without limitation the rights to
    18   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    19   * of the Software, and to permit persons to whom the Software is furnished to do
    20   * so, subject to the following conditions:
    21   *
    22   * The above copyright notice and this permission notice shall be included in all
    23   * copies or substantial portions of the Software.
    24   *
    25   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    26   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    27   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    28   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    29   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    30   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    31   * SOFTWARE.
    32   */
    33  
    34  package conn
    35  
    36  // getGSOSize parses control for UDP_GRO and if found returns its GSO size data.
    37  func getGSOSize(control []byte) (int, error) {
    38  	return 0, nil
    39  }
    40  
    41  // setGSOSize sets a UDP_SEGMENT in control based on gsoSize.
    42  func setGSOSize(control *[]byte, gsoSize uint16) {
    43  }
    44  
    45  // gsoControlSize returns the recommended buffer size for pooling sticky and UDP
    46  // offloading control data.
    47  const gsoControlSize = 0