Skip to content

Commit 1cf9c5a

Browse files
committed
mk: upgrade to Go 1.19
1 parent f65cbb3 commit 1cf9c5a

File tree

30 files changed

+122
-100
lines changed

30 files changed

+122
-100
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- uses: actions/setup-go@v3
2323
with:
24-
go-version: ^1.18
24+
go-version: ^1.19
2525
- uses: actions/setup-node@v3
2626
with:
2727
node-version: 16
@@ -128,7 +128,7 @@ jobs:
128128
steps:
129129
- uses: actions/setup-go@v3
130130
with:
131-
go-version: ^1.18
131+
go-version: ^1.19
132132
- name: Install TinyGo
133133
run: |
134134
wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb

cmd/ndndpdk-ctrl/common.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,12 @@ func (r request) Print() error {
270270
}
271271

272272
// clientDoPrint either runs a GraphQL query/mutation/subscription or prints the command to stdout.
273-
// query: GraphQL document, which should contain exactly one GraphQL operation.
274-
// vars: query variables.
275-
// key: top-level JSON property key to extract from response.
276-
// ptr: for query/mutation, pointer to a variable for receiving the response;
277-
// for subscription, `func(T)` or `func(T) bool` for receiving each update, return false to unsubscribe.
273+
//
274+
// query: GraphQL document, which should contain exactly one GraphQL operation.
275+
// vars: query variables.
276+
// key: top-level JSON property key to extract from response.
277+
// ptr: for query/mutation, pointer to a variable for receiving the response;
278+
// for subscription, `func(T)` or `func(T) bool` for receiving each update, return false to unsubscribe.
278279
func clientDoPrint(ctx context.Context, query string, vars map[string]any, key string, ptr ...any) error {
279280
r := request{
280281
Query: query,

container/fib/fibtestenv/entry.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ func DummyStrategy() *strategycode.Strategy {
1919
}
2020

2121
// MakeEntry builds a fibdef.Entry.
22-
// name: ndn.Name or string
23-
// sc: int or *strategycode.Strategy or nil
22+
//
23+
// name: ndn.Name or string
24+
// sc: int or *strategycode.Strategy or nil
2425
func MakeEntry(name, sc any, nexthops ...iface.ID) (entry fibdef.Entry) {
2526
switch n := name.(type) {
2627
case ndn.Name:

core/gqlclient/gqlclient.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ func (c *Client) Close() error {
5353
}
5454

5555
// Do runs a query or mutation on the GraphQL server.
56-
// ctx: a Context for canceling the operation.
57-
// query: a GraphQL document.
58-
// vars: query variables.
59-
// key: if non-empty, unmarshal result.data[key] instead of result.data.
60-
// res: pointer to result struct.
56+
//
57+
// ctx: a Context for canceling the operation.
58+
// query: a GraphQL document.
59+
// vars: query variables.
60+
// key: if non-empty, unmarshal result.data[key] instead of result.data.
61+
// res: pointer to result struct.
6162
func (c *Client) Do(ctx context.Context, query string, vars map[string]any, key string, res any) error {
6263
c.wg.Add(1)
6364
defer c.wg.Done()
@@ -91,11 +92,12 @@ func (c *Client) Delete(ctx context.Context, id string) (deleted bool, e error)
9192
}
9293

9394
// Subscribe performs a subscription on the GraphQL server.
94-
// ctx: a Context for canceling the subscription.
95-
// query: a GraphQL document.
96-
// vars: query variables.
97-
// key: if non-empty, unmarshal result.data[key] instead of result.data.
98-
// res: channel for sending updates.
95+
//
96+
// ctx: a Context for canceling the subscription.
97+
// query: a GraphQL document.
98+
// vars: query variables.
99+
// key: if non-empty, unmarshal result.data[key] instead of result.data.
100+
// res: channel for sending updates.
99101
func (c *Client) Subscribe(ctx context.Context, query string, vars map[string]any, key string, res any) error {
100102
c.wg.Add(1)
101103
defer c.wg.Done()

core/logging/logging.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ func Named(pkg string) *zap.Logger {
2626
// New creates a logger initialized with configured log level.
2727
//
2828
// By NDN-DPDK codebase convention, this should appear in the same .go file as the package docstring:
29-
// var logger = logging.New("Foo")
29+
//
30+
// var logger = logging.New("Foo")
3031
func New(pkg string) *zap.Logger {
3132
return Named(pkg).WithOptions(zap.IncreaseLevel(GetLevel(pkg).al))
3233
}

core/subtract/subtract.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ func subV(currV, prevV reflect.Value) (diffV reflect.Value) {
3131
// It assigns the result to a pointer to the same type.
3232
//
3333
// This function can handle these field types:
34-
// - unsigned/signed integer.
35-
// - struct (recursive).
36-
// - slice (recursive, truncated to the shorter slice).
37-
// - array (recursive).
34+
// - unsigned/signed integer.
35+
// - struct (recursive).
36+
// - slice (recursive, truncated to the shorter slice).
37+
// - array (recursive).
38+
//
3839
// Other fields are ignored.
3940
// A field may be explicitly skipped with `subtract:"-"` tag.
4041
func SubFields[T any](curr, prev T, diffPtr *T) {

docs/INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can also [build a Docker container](Docker.md), which would work on other op
1111
* Linux kernel 5.4 or newer (install `linux-generic-hwe-18.04` on Ubuntu 18.04)
1212
* Required APT packages: `build-essential clang-11 git jq libc6-dev-i386 libelf-dev libpcap-dev libssl-dev liburcu-dev ninja-build pkg-config` (enable [llvm-toolchain-bionic-11](https://apt.llvm.org/) repository on Ubuntu 18.04)
1313
* Optional APT packages: `clang-format-11 doxygen lcov yamllint`
14-
* Go 1.18
14+
* Go 1.19
1515
* Node.js 16.x
1616
* [Meson build system](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip)
1717
* [ubpf](https://github.com/iovisor/ubpf) 48e526d8

docs/interop/yanfd/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.18-bullseye AS build
1+
FROM golang:1.19-bullseye AS build
22
RUN apt-get -y -qq update && \
33
apt-get -y -qq install --no-install-recommends ca-certificates wget && \
44
rm -rf /var/lib/apt/lists/*

dpdk/cryptodev/queue-pair.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func (qp *QueuePair) CopyToC(ptr unsafe.Pointer) {
3333
}
3434

3535
// PrepareSha256 prepares a SHA256 digest generation operation.
36-
// m[offset:offset+length] is the input to SHA256 digest function.
37-
// output must have 32 bytes in C memory.
36+
//
37+
// m[offset:offset+length] is the input to SHA256 digest function.
38+
// output must have 32 bytes in C memory.
3839
func (qp *QueuePair) PrepareSha256(op *Op, m *pktmbuf.Packet, offset, length int, output unsafe.Pointer) {
3940
C.CryptoQueuePair_PrepareSha256(&qp.c, &op.op, (*C.struct_rte_mbuf)(m.Ptr()),
4041
C.uint32_t(offset), C.uint32_t(length), (*C.uint8_t)(output))

dpdk/eal/numa-socket.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ type WithNumaSocket interface {
135135
}
136136

137137
// ClassifyByNumaSocket classifies items by NUMA socket.
138-
// T: type that satisfies WithNumaSocket interface
139-
// s: source []T
138+
//
139+
// T: type that satisfies WithNumaSocket interface
140+
// s: source []T
141+
//
140142
// Returns map[eal.NumaSocket][]T
141143
func ClassifyByNumaSocket[T WithNumaSocket, S ~[]T](s S, r RewriteAnyNumaSocket) (m map[NumaSocket]S) {
142144
m = map[NumaSocket]S{}

dpdk/ealthread/allocator.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ func AllocFree(lcores ...eal.LCore) {
104104
// AllocClear deletes all allocations.
105105
//
106106
// When this is used together with eal.UpdateLCoreSockets mock in a test case, the cleanup statement should be ordered as:
107-
// defer eal.UpdateLCoreSockets(...)()
108-
// defer ealthread.AllocClear()
107+
//
108+
// defer eal.UpdateLCoreSockets(...)()
109+
// defer ealthread.AllocClear()
110+
//
109111
// This ensures AllocClear() clears allocations for mocked workers instead of real workers.
110112
func AllocClear() {
111113
allocFree(eal.Workers, true)

dpdk/ealthread/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ func (c Config) assignWorkers(filter eal.LCorePredicate) (m map[string]eal.LCore
106106
// RoleConfig contains lcore allocation config for a role.
107107
//
108108
// In JSON, it should be either:
109-
// - a list of lcore IDs, which cannot overlap with other roles.
110-
// - an object, where each key is a NUMA socket and each value is the number of lcores on this socket.
109+
// - a list of lcore IDs, which cannot overlap with other roles.
110+
// - an object, where each key is a NUMA socket and each value is the number of lcores on this socket.
111111
type RoleConfig struct {
112112
LCores []int
113113
PerNuma map[int]int

dpdk/ealthread/ctrl.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const sleepEnabled = C.ENABLE_THREADSLEEP > 0
2727
//
2828
// Initially, the sleep duration is SleepMin.
2929
// Once every SleepAdjustEvery consecutive empty polls, the sleep duration is adjusted as:
30-
// d = MIN(SleepMax, d * SleepMultiply / SleepDivide + SleepAdd)
30+
//
31+
// d = MIN(SleepMax, d * SleepMultiply / SleepDivide + SleepAdd)
32+
//
3133
// After a valid poll, i.e. processed non-zero packets, the sleep duration is reset to SleepMin.
3234
//
3335
// All durations are in nanoseconds unit.

dpdk/spdkenv/spdkenvtest/json_ctest.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import (
1717
var makeAR = testenv.MakeAR
1818

1919
// As of SPDK 22.01, explicitly calling a function in libspdk_env_dpdk.so is needed to prevent a linker error:
20-
// /usr/local/lib/libspdk_util.so: undefined reference to `spdk_realloc'
20+
//
21+
// /usr/local/lib/libspdk_util.so: undefined reference to `spdk_realloc'
2122
var _ = C.spdk_env_get_core_count()
2223

2324
func ctestJSON(t *testing.T) {

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/usnistgov/ndn-dpdk
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/EGT-Ukraine/go2gql v0.0.0-20190528134259-79533208556f
@@ -14,7 +14,7 @@ require (
1414
github.com/google/gopacket v1.1.19
1515
github.com/graphql-go/graphql v0.8.0
1616
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20220405231054-a1ae3e4bba26
17-
github.com/jacobsa/fuse v0.0.0-20220718111527-9cc4ff0bc91d
17+
github.com/jacobsa/fuse v0.0.0-20220726073400-226fec2ce902
1818
github.com/jfoster/binary-utilities v0.2.1
1919
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
2020
github.com/korylprince/go-graphql-ws v0.3.6
@@ -32,16 +32,16 @@ require (
3232
github.com/stretchr/testify v1.8.0
3333
github.com/suzuki-shunsuke/go-dataeq v1.0.1
3434
github.com/tul/emission v0.0.0-20180606124623-7d2aae804ca2
35-
github.com/urfave/cli/v2 v2.11.0
35+
github.com/urfave/cli/v2 v2.11.1
3636
github.com/vishvananda/netlink v1.1.0
3737
github.com/xeipuuv/gojsonschema v1.2.0
3838
github.com/zyedidia/generic v1.1.0
3939
go.uber.org/atomic v1.9.0
4040
go.uber.org/multierr v1.8.0
4141
go.uber.org/zap v1.21.0
4242
go4.org v0.0.0-20201209231011-d4a079459e60
43-
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75
44-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8
43+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
44+
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704
4545
)
4646

4747
require (

go.sum

+8-7
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ github.com/ianlancetaylor/cgosymbolizer v0.0.0-20220405231054-a1ae3e4bba26/go.mo
274274
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
275275
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
276276
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
277-
github.com/jacobsa/fuse v0.0.0-20220718111527-9cc4ff0bc91d h1:OGIARxvpS24WI+OYzuiQPj6+o3DbWOv+0aiPPHMBG9k=
278-
github.com/jacobsa/fuse v0.0.0-20220718111527-9cc4ff0bc91d/go.mod h1:liOmRdJd8oTwHCQ5M9JemRE3CebdlYcZWLk+ZjQeuq0=
277+
github.com/jacobsa/fuse v0.0.0-20220726073400-226fec2ce902 h1:/IQH2E2OKt1gyALxVdOMBOqHt71CXHrCBxCyrUORe3o=
278+
github.com/jacobsa/fuse v0.0.0-20220726073400-226fec2ce902/go.mod h1:liOmRdJd8oTwHCQ5M9JemRE3CebdlYcZWLk+ZjQeuq0=
279279
github.com/jfoster/binary-utilities v0.2.1 h1:QlsTWJTe4X/CI69z3MBtp5m2oyW1txX7jaxqaIBUfhg=
280280
github.com/jfoster/binary-utilities v0.2.1/go.mod h1:i/pKfbFZeEXPpWZAdXBPfFXQDMWU+ltImrklLVPsrrI=
281281
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -441,8 +441,8 @@ github.com/tul/emission v0.0.0-20180606124623-7d2aae804ca2 h1:iPOayn1rRdG1AB2T/W
441441
github.com/tul/emission v0.0.0-20180606124623-7d2aae804ca2/go.mod h1:ANCVehq/ebSfxkRMtL7xwd64CRO6GXnf42j06yeC1JA=
442442
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
443443
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
444-
github.com/urfave/cli/v2 v2.11.0 h1:c6bD90aLd2iEsokxhxkY5Er0zA2V9fId2aJfwmrF+do=
445-
github.com/urfave/cli/v2 v2.11.0/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
444+
github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE=
445+
github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
446446
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
447447
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
448448
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=
@@ -511,8 +511,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
511511
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
512512
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
513513
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
514-
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75 h1:x03zeu7B2B11ySp+daztnwM5oBJ/8wGUSqrwcw9L0RA=
515-
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
514+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
515+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
516516
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
517517
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
518518
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -687,8 +687,9 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc
687687
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
688688
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
689689
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
690-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
691690
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
691+
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 h1:Y7NOhdqIOU8kYI7BxsgL38d0ot0raxvcW+EMQU2QrT4=
692+
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
692693
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
693694
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
694695
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=

iface/ethport/locator.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ func (hdr TxHdr) IPLen() int {
8787
}
8888

8989
// Prepend prepends headers to an outgoing packet.
90-
// newBurst: whether pkt is the first packet in a burst. It increments UDP source port in VXLAN
91-
// headers. If NDN network layer packet is fragmented, only the first fragment might
92-
// start a new burst, so that all fragments have the same UDP source port.
90+
//
91+
// newBurst: whether pkt is the first packet in a burst. It increments UDP source port in VXLAN
92+
// headers. If NDN network layer packet is fragmented, only the first fragment might
93+
// start a new burst, so that all fragments have the same UDP source port.
9394
func (hdr TxHdr) Prepend(pkt *pktmbuf.Packet, newBurst bool) {
9495
C.EthTxHdr_Prepend((*C.EthTxHdr)(&hdr), (*C.struct_rte_mbuf)(pkt.Ptr()), C.bool(newBurst))
9596
}

ndn/data.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ var (
3232

3333
// MakeData creates a Data from flexible arguments.
3434
// Arguments can contain:
35-
// - string or Name: set Name
36-
// - ContentType
37-
// - time.Duration: set Freshness
38-
// - FinalBlock: set FinalBlock
39-
// - FinalBlockFlag: set FinalBlock to the last name component, ignored if name is empty
40-
// - []byte: set Content
41-
// - LpL3: copy PitToken and CongMark
42-
// - Interest or *Interest: copy Name, set FreshnessPeriod if Interest has MustBeFresh, inherit LpL3
35+
// - string or Name: set Name
36+
// - ContentType
37+
// - time.Duration: set Freshness
38+
// - FinalBlock: set FinalBlock
39+
// - FinalBlockFlag: set FinalBlock to the last name component, ignored if name is empty
40+
// - []byte: set Content
41+
// - LpL3: copy PitToken and CongMark
42+
// - Interest or *Interest: copy Name, set FreshnessPeriod if Interest has MustBeFresh, inherit LpL3
4343
func MakeData(args ...any) (data Data) {
4444
data.packet = &Packet{}
4545
hasFinalBlockFlag := false

ndn/endpoint/lface.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//
33
// Endpoint is the basic abstraction through which an application can communicate with the NDN network.
44
// It is similar to "client face" in other NDN libraries, with the enhancement that it handles these details automatically:
5-
// - Outgoing packets are signed and incoming packets are verified, if keys are provided.
6-
// - Outgoing Interests are transmitted periodically, if retransmission policy is specified.
5+
// - Outgoing packets are signed and incoming packets are verified, if keys are provided.
6+
// - Outgoing Interests are transmitted periodically, if retransmission policy is specified.
77
package endpoint
88

99
import (

ndn/endpoint/producer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ func ReplyNack(reason uint8) error {
3030
}
3131

3232
// ProducerHandler is a producer handler function.
33-
// - If it returns an error created with ReplyNack(), a Nack is sent in reply to the Interest.
34-
// - If it returns a Data that satisfies the Interest, the Data is sent in reply to the Interest.
35-
// - Otherwise, nothing is sent.
33+
// - If it returns an error created with ReplyNack(), a Nack is sent in reply to the Interest.
34+
// - If it returns a Data that satisfies the Interest, the Data is sent in reply to the Interest.
35+
// - Otherwise, nothing is sent.
3636
type ProducerHandler func(ctx context.Context, interest ndn.Interest) (ndn.Data, error)
3737

3838
// ProducerOptions contains arguments to Produce function.

ndn/interest.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ var (
3838

3939
// MakeInterest creates an Interest from flexible arguments.
4040
// Arguments can contain:
41-
// - string or Name: set Name
42-
// - CanBePrefixFlag: set CanBePrefix
43-
// - MustBeFreshFlag: set MustBeFresh
44-
// - ForwardingHint: set forwarding hint
45-
// - Nonce: set Nonce
46-
// - time.Duration: set Lifetime
47-
// - HopLimit: set HopLimit
48-
// - []byte: set AppParameters
49-
// - LpL3: copy PitToken and CongMark
41+
// - string or Name: set Name
42+
// - CanBePrefixFlag: set CanBePrefix
43+
// - MustBeFreshFlag: set MustBeFresh
44+
// - ForwardingHint: set forwarding hint
45+
// - Nonce: set Nonce
46+
// - time.Duration: set Lifetime
47+
// - HopLimit: set HopLimit
48+
// - []byte: set AppParameters
49+
// - LpL3: copy PitToken and CongMark
5050
func MakeInterest(args ...any) (interest Interest) {
5151
interest.packet = &Packet{}
5252
for _, arg := range args {

ndn/l3/forwarder.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import (
1212
// Its main purpose is to demultiplex incoming packets among faces, where a 'face' is defined as a duplex stream of packets.
1313
//
1414
// This is a simplified forwarder with several limitations.
15-
// - There is no loop prevention: no Nonce list and no decrementing HopLimit.
16-
// If multiple uplinks have "/" route, Interests will be forwarded among them and might cause persistent loops.
17-
// Thus, it is not recommended to connect to multiple uplinks with overlapping routes.
18-
// - There is no pending Interest table. Instead, downstream 'face' ID is inserted as part of the PIT token.
19-
// Since PIT token cannot exceed 32 octets, this takes away some space.
20-
// Thus, consumers are allowed to use a PIT token up to 28 octets; Interests with longer PIT tokens may be dropped.
15+
// - There is no loop prevention: no Nonce list and no decrementing HopLimit.
16+
// If multiple uplinks have "/" route, Interests will be forwarded among them and might cause persistent loops.
17+
// Thus, it is not recommended to connect to multiple uplinks with overlapping routes.
18+
// - There is no pending Interest table. Instead, downstream 'face' ID is inserted as part of the PIT token.
19+
// Since PIT token cannot exceed 32 octets, this takes away some space.
20+
// Thus, consumers are allowed to use a PIT token up to 28 octets; Interests with longer PIT tokens may be dropped.
2121
type Forwarder interface {
2222
// AddFace adds a Face to the forwarder.
2323
// face.Rx() and face.Tx() should not be used after this operation.

ndn/memiftransport/locator.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ func (loc Locator) rsize() uint8 {
120120
}
121121

122122
// ToVDevArgs builds arguments for DPDK virtual device.
123-
// key: a unique key for each memif vdev; creating vdev with duplicate key would fail.
124-
// args: arguments passed to eal.NewVDev() function.
123+
//
124+
// key: a unique key for each memif vdev; creating vdev with duplicate key would fail.
125+
// args: arguments passed to eal.NewVDev() function.
125126
func (loc *Locator) ToVDevArgs() (args map[string]any, e error) {
126127
if e = loc.Validate(); e != nil {
127128
return nil, e

0 commit comments

Comments
 (0)