Documentation
¶
Index ¶
- Constants
- func FindCIDRAddress(inter string) (string, error)
- func IPPortToAddress(ip net.IP, port int) *btypes.Address
- func UDPToAddress(n *net.UDPAddr) *btypes.Address
- type DataLink
- type MockDataLink
- func (m *MockDataLink) Close() error
- func (m *MockDataLink) GetBroadcastAddress() *btypes.Address
- func (m *MockDataLink) GetMyAddress() *btypes.Address
- func (m *MockDataLink) Receive(data []byte) (*btypes.Address, int, error)
- func (m *MockDataLink) Send(data []byte, npdu *btypes.NPDU, dest *btypes.Address) (int, error)
- type ReceivedMessage
- type SentMessage
Constants ¶
View Source
const DefaultPort = 0xBAC0 //47808
DefaultPort that BacnetIP will use if a port is not given. Valid ports for the bacnet protocol is between 0xBAC0 and 0xBAC9
Variables ¶
This section is empty.
Functions ¶
func FindCIDRAddress ¶
FindCIDRAddress find out CIDR address from net interface
func IPPortToAddress ¶
IPPortToAddress converts a given udp address into a bacnet address
Types ¶
type DataLink ¶
type DataLink interface {
GetMyAddress() *btypes.Address
GetBroadcastAddress() *btypes.Address
Send(data []byte, npdu *btypes.NPDU, dest *btypes.Address) (int, error)
Receive(data []byte) (*btypes.Address, int, error)
Close() error
}
func NewPcapDataLink ¶
func NewUDPDataLink ¶
NewUDPDataLink returns udp listener pass in your iface port by name, see an alternative NewUDPDataLinkFromIP if you wish to pass in by ip and subnet
- inter: eth0
- addr: 47808
type MockDataLink ¶
type MockDataLink struct {
// Messages that have been sent with the Send method
Sent []SentMessage
// Messages that we are simulating receiving with the Receive method
Received []ReceivedMessage
MyAddress *btypes.Address
BroadcastAddress *btypes.Address
}
func NewMockDataLink ¶
func NewMockDataLink() *MockDataLink
func (*MockDataLink) Close ¶
func (m *MockDataLink) Close() error
func (*MockDataLink) GetBroadcastAddress ¶
func (m *MockDataLink) GetBroadcastAddress() *btypes.Address
func (*MockDataLink) GetMyAddress ¶
func (m *MockDataLink) GetMyAddress() *btypes.Address
Click to show internal directories.
Click to hide internal directories.