github.com/osrg/gobgp@v2.0.0+incompatible/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  // +build !linux,!openbsd
    16  
    17  package server
    18  
    19  import (
    20  	"net"
    21  	"syscall"
    22  
    23  	log "github.com/sirupsen/logrus"
    24  )
    25  
    26  func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error {
    27  	return setTcpMD5SigSockopt(l, address, key)
    28  }
    29  
    30  func setListenTCPTTLSockopt(l *net.TCPListener, ttl int) error {
    31  	return setListenTcpTTLSockopt(l, ttl)
    32  }
    33  
    34  func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error {
    35  	return setTcpTTLSockopt(conn, ttl)
    36  }
    37  
    38  func setTCPMinTTLSockopt(conn *net.TCPConn, ttl int) error {
    39  	return setTcpMinTTLSockopt(conn, ttl)
    40  }
    41  
    42  func dialerControl(network, address string, c syscall.RawConn, ttl, ttlMin uint8, password string) error {
    43  	if password != "" {
    44  		log.WithFields(log.Fields{
    45  			"Topic": "Peer",
    46  			"Key":   address,
    47  		}).Warn("setting md5 for active connection is not supported")
    48  	}
    49  	if ttl != 0 {
    50  		log.WithFields(log.Fields{
    51  			"Topic": "Peer",
    52  			"Key":   address,
    53  		}).Warn("setting ttl for active connection is not supported")
    54  	}
    55  	if ttlMin != 0 {
    56  		log.WithFields(log.Fields{
    57  			"Topic": "Peer",
    58  			"Key":   address,
    59  		}).Warn("setting min ttl for active connection is not supported")
    60  	}
    61  	return nil
    62  }