MCPcopy Create free account
hub / github.com/brimdata/super / Call

Method Call

runtime/vam/expr/function/networkof.go:14–32  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

12}
13
14func (n *NetworkOf) Call(args ...vector.Any) vector.Any {
15 args = underAll(args)
16 ipvec := args[0]
17 if ipvec.Type().ID() != super.IDIP {
18 return vector.NewWrappedError(n.sctx, "network_of: not an IP", ipvec)
19 }
20 if len(args) == 1 {
21 return n.singleIP(ipvec)
22 }
23 maskvec := args[1]
24 switch id := maskvec.Type().ID(); {
25 case id == super.IDIP:
26 return n.ipMask(ipvec, maskvec)
27 case super.IsInteger(id):
28 return n.intMask(ipvec, maskvec)
29 default:
30 return vector.NewWrappedError(n.sctx, "network_of: bad arg for CIDR mask", maskvec)
31 }
32}
33
34func (n *NetworkOf) singleIP(vec vector.Any) vector.Any {
35 var errs []uint32

Callers

nothing calls this directly

Calls 8

singleIPMethod · 0.95
ipMaskMethod · 0.95
intMaskMethod · 0.95
NewWrappedErrorFunction · 0.92
IsIntegerFunction · 0.92
underAllFunction · 0.70
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected