Skip to content

Commit 6ee5668

Browse files
authored
Merge pull request #1757 from tuftedocelot/connectionspid
[openbsd] set ConnectionsPid to return NotImplemented
2 parents ee47ca6 + bca28ce commit 6ee5668

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

net/net_openbsd.go

+63
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,66 @@ func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat,
334334

335335
return ret, nil
336336
}
337+
338+
// Return a list of network connections opened by a process.
339+
func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) {
340+
return ConnectionsPidWithContext(context.Background(), kind, pid)
341+
}
342+
343+
func ConnectionsPidWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) {
344+
return nil, common.ErrNotImplementedError
345+
}
346+
347+
// Return a list of network connections opened returning at most `max`
348+
// connections for each running process.
349+
func ConnectionsMax(kind string, maxConn int) ([]ConnectionStat, error) {
350+
return ConnectionsMaxWithContext(context.Background(), kind, maxConn)
351+
}
352+
353+
func ConnectionsMaxWithContext(ctx context.Context, kind string, maxConn int) ([]ConnectionStat, error) {
354+
return nil, common.ErrNotImplementedError
355+
}
356+
357+
// Return up to `max` network connections opened by a process.
358+
func ConnectionsPidMax(kind string, pid int32, maxConn int) ([]ConnectionStat, error) {
359+
return ConnectionsPidMaxWithContext(context.Background(), kind, pid, maxConn)
360+
}
361+
362+
func ConnectionsPidMaxWithContext(ctx context.Context, kind string, pid int32, maxConn int) ([]ConnectionStat, error) {
363+
return nil, common.ErrNotImplementedError
364+
}
365+
366+
// Return a list of network connections opened, omitting `Uids`.
367+
// WithoutUids functions are reliant on implementation details. They may be altered to be an alias for Connections or be
368+
// removed from the API in the future.
369+
func ConnectionsWithoutUids(kind string) ([]ConnectionStat, error) {
370+
return ConnectionsWithoutUidsWithContext(context.Background(), kind)
371+
}
372+
373+
func ConnectionsWithoutUidsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
374+
return ConnectionsMaxWithoutUidsWithContext(ctx, kind, 0)
375+
}
376+
377+
func ConnectionsMaxWithoutUidsWithContext(ctx context.Context, kind string, maxConn int) ([]ConnectionStat, error) {
378+
return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, 0, maxConn)
379+
}
380+
381+
func ConnectionsPidWithoutUids(kind string, pid int32) ([]ConnectionStat, error) {
382+
return ConnectionsPidWithoutUidsWithContext(context.Background(), kind, pid)
383+
}
384+
385+
func ConnectionsPidWithoutUidsWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) {
386+
return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, 0)
387+
}
388+
389+
func ConnectionsPidMaxWithoutUids(kind string, pid int32, maxConn int) ([]ConnectionStat, error) {
390+
return ConnectionsPidMaxWithoutUidsWithContext(context.Background(), kind, pid, maxConn)
391+
}
392+
393+
func ConnectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, maxConn int) ([]ConnectionStat, error) {
394+
return connectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, maxConn)
395+
}
396+
397+
func connectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, maxConn int) ([]ConnectionStat, error) {
398+
return nil, common.ErrNotImplementedError
399+
}

0 commit comments

Comments
 (0)