(a *api.BfdPeerConfig)
| 982 | } |
| 983 | |
| 984 | func newBfdConfigFromAPIStruct(a *api.BfdPeerConfig) (oc.BfdConfig, error) { |
| 985 | if a == nil { |
| 986 | return oc.BfdConfig{}, nil |
| 987 | } |
| 988 | if a.Port > uint32(^uint16(0)) { |
| 989 | return oc.BfdConfig{}, fmt.Errorf("invalid BFD port: %d", a.Port) |
| 990 | } |
| 991 | if a.DetectionMultiplier > uint32(^uint8(0)) { |
| 992 | return oc.BfdConfig{}, fmt.Errorf("invalid BFD detection multiplier: %d", a.DetectionMultiplier) |
| 993 | } |
| 994 | |
| 995 | return oc.BfdConfig{ |
| 996 | Enabled: a.Enabled, |
| 997 | Port: uint16(a.Port), |
| 998 | DesiredMinimumTxInterval: a.DesiredMinimumTxInterval, |
| 999 | RequiredMinimumReceive: a.RequiredMinimumReceive, |
| 1000 | DetectionMultiplier: uint8(a.DetectionMultiplier), |
| 1001 | }, nil |
| 1002 | } |
| 1003 | |
| 1004 | func newNeighborFromAPIStruct(a *api.Peer) (*oc.Neighbor, error) { |
| 1005 | pconf := &oc.Neighbor{} |
no outgoing calls
searching dependent graphs…