]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-pkt/main.go
ACK
[nncp.git] / src / cmd / nncp-pkt / main.go
index c22b1f71038e209bda406fe3c5bf5903420c6291..d40b8c5f859a969296acab7d012dc53fdb123721 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -74,6 +74,8 @@ func doPlain(ctx *nncp.Ctx, pkt nncp.Pkt, dump, decompress bool) {
                payloadType = "exec uncompressed"
        case nncp.PktTypeArea:
                payloadType = "area"
+       case nncp.PktTypeACK:
+               payloadType = "acknowledgement"
        }
        var path string
        switch pkt.Type {
@@ -92,6 +94,8 @@ func doPlain(ctx *nncp.Ctx, pkt nncp.Pkt, dump, decompress bool) {
                if areaId, err := nncp.AreaIdFromString(path); err == nil {
                        path = fmt.Sprintf("%s (%s)", path, ctx.AreaName(areaId))
                }
+       case nncp.PktTypeACK:
+               path = nncp.Base32Codec.EncodeToString(pkt.Path[:pkt.PathLen])
        default:
                path = string(pkt.Path[:pkt.PathLen])
        }