github.com/osrg/gobgp/v3@v3.30.0/pkg/server/sockopt.go (about)

     1  // Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //    http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    12  // implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  //go:build !linux && !openbsd && !windows
    16  // +build !linux,!openbsd,!windows
    17  
    18  package server
    19  
    20  import (
    21  	"fmt"
    22  	"net"
    23  	"syscall"
    24  
    25  	"github.com/osrg/gobgp/v3/pkg/log"
    26  )
    27  
    28  func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error {
    29  	return setTcpMD5SigSockopt(l, address, key)
    30  }
    31  
    32  func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error {
    33  	return setTcpTTLSockopt(conn, ttl)
    34  }
    35  
    36  func setTCPMinTTLSockopt(conn *net.TCPConn, ttl int) error {
    37  	return setTcpMinTTLSockopt(conn, ttl)
    38  }
    39  
    40  func setBindToDevSockopt(sc syscall.RawConn, device string) error {
    41  	return fmt.Errorf("binding connection to a device is not supported")
    42  }
    43  
    44  func setTCPMSSSockopt(conn *net.TCPConn, mss uint16) error {
    45  	return setTcpMSSSockopt(conn, mss)
    46  }
    47  
    48  func dialerControl(logger log.Logger, network, address string, c syscall.RawConn, ttl, minTtl uint8, mss uint16, password string, bindInterface string) error {
    49  	if password != "" {
    50  		logger.Warn("setting md5 for active connection is not supported",
    51  			log.Fields{
    52  				"Topic": "Peer",
    53  				"Key":   address})
    54  	}
    55  	if ttl != 0 {
    56  		logger.Warn("setting ttl for active connection is not supported",
    57  			log.Fields{
    58  				"Topic": "Peer",
    59  				"Key":   address})
    60  	}
    61  	if minTtl != 0 {
    62  		logger.Warn("setting min ttl for active connection is not supported",
    63  			log.Fields{
    64  				"Topic": "Peer",
    65  				"Key":   address})
    66  	}
    67  	if mss != 0 {
    68  		logger.Warn("setting MSS for active connection is not supported",
    69  			log.Fields{
    70  				"Topic": "Peer",
    71  				"Key":   address})
    72  	}
    73  	return nil
    74  }