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

     1  //go:build windows
     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 transport
    35  
    36  const (
    37  	QueueStagedSize            = 128
    38  	QueueOutboundSize          = 1024
    39  	QueueInboundSize           = 1024
    40  	QueueHandshakeSize         = 1024
    41  	MaxSegmentSize             = 2048 - 32 // largest possible UDP datagram
    42  	PreallocatedBuffersPerPool = 0         // Disable and allow for infinite memory growth
    43  )