| 1 |
// +build !linux linux,386 |
| 2 |
// Copyright 2019 Wataru Ishida. All rights reserved. |
| 3 |
// |
| 4 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
// you may not use this file except in compliance with the License. |
| 6 |
// You may obtain a copy of the License at |
| 7 |
// |
| 8 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
// |
| 10 |
// Unless required by applicable law or agreed to in writing, software |
| 11 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 |
// implied. |
| 14 |
// See the License for the specific language governing permissions and |
| 15 |
// limitations under the License. |
| 16 |
|
| 17 |
package sctp |
| 18 |
|
| 19 |
import ( |
| 20 |
"errors" |
| 21 |
"net" |
| 22 |
"runtime" |
| 23 |
"syscall" |
| 24 |
) |
| 25 |
|
| 26 |
var ErrUnsupported = errors.New("SCTP is unsupported on " + runtime.GOOS + "/" + runtime.GOARCH) |
| 27 |
|
| 28 |
func setsockopt(fd int, optname, optval, optlen uintptr) (uintptr, uintptr, error) { |
| 29 |
return 0, 0, ErrUnsupported |
| 30 |
} |
| 31 |
|
| 32 |
func getsockopt(fd int, optname, optval, optlen uintptr) (uintptr, uintptr, error) { |
| 33 |
return 0, 0, ErrUnsupported |
| 34 |
} |
| 35 |
|
| 36 |
func (c *SCTPConn) SCTPWrite(b []byte, info *SndRcvInfo) (int, error) { |
| 37 |
return 0, ErrUnsupported |
| 38 |
} |
| 39 |
|
| 40 |
func (c *SCTPConn) SCTPRead(b []byte) (int, *SndRcvInfo, error) { |
| 41 |
return 0, nil, ErrUnsupported |
| 42 |
} |
| 43 |
|
| 44 |
func (c *SCTPConn) Close() error { |
| 45 |
return ErrUnsupported |
| 46 |
} |
| 47 |
|
| 48 |
func (c *SCTPConn) SetWriteBuffer(bytes int) error { |
| 49 |
return ErrUnsupported |
| 50 |
} |
| 51 |
|
| 52 |
func (c *SCTPConn) GetWriteBuffer() (int, error) { |
| 53 |
return 0, ErrUnsupported |
| 54 |
} |
| 55 |
|
| 56 |
func (c *SCTPConn) SetReadBuffer(bytes int) error { |
| 57 |
return ErrUnsupported |
| 58 |
} |
| 59 |
|
| 60 |
func (c *SCTPConn) GetReadBuffer() (int, error) { |
| 61 |
return 0, ErrUnsupported |
| 62 |
} |
| 63 |
|
| 64 |
func ListenSCTP(net string, laddr *SCTPAddr) (*SCTPListener, error) { |
| 65 |
return nil, ErrUnsupported |
| 66 |
} |
| 67 |
|
| 68 |
func ListenSCTPExt(net string, laddr *SCTPAddr, options InitMsg) (*SCTPListener, error) { |
| 69 |
return nil, ErrUnsupported |
| 70 |
} |
| 71 |
|
| 72 |
func listenSCTPExtConfig(network string, laddr *SCTPAddr, options InitMsg, control func(network, address string, c syscall.RawConn) error) (*SCTPListener, error) { |
| 73 |
return nil, ErrUnsupported |
| 74 |
} |
| 75 |
|
| 76 |
func (ln *SCTPListener) Accept() (net.Conn, error) { |
| 77 |
return nil, ErrUnsupported |
| 78 |
} |
| 79 |
|
| 80 |
func (ln *SCTPListener) AcceptSCTP() (*SCTPConn, error) { |
| 81 |
return nil, ErrUnsupported |
| 82 |
} |
| 83 |
|
| 84 |
func (ln *SCTPListener) Close() error { |
| 85 |
return ErrUnsupported |
| 86 |
} |
| 87 |
|
| 88 |
func DialSCTP(net string, laddr, raddr *SCTPAddr) (*SCTPConn, error) { |
| 89 |
return nil, ErrUnsupported |
| 90 |
} |
| 91 |
|
| 92 |
func DialSCTPExt(network string, laddr, raddr *SCTPAddr, options InitMsg) (*SCTPConn, error) { |
| 93 |
return nil, ErrUnsupported |
| 94 |
} |
| 95 |
|
| 96 |
func dialSCTPExtConfig(network string, laddr, raddr *SCTPAddr, options InitMsg, control func(network, address string, c syscall.RawConn) error) (*SCTPConn, error) { |
| 97 |
return nil, ErrUnsupported |
| 98 |
} |