]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-pkt/main.go
Merge branch 'develop'
[nncp.git] / src / cmd / nncp-pkt / main.go
index 3f42cd260e48a25c2f404b94ea769243f4be68db..3245970266713ae810ce9c852194cb28e4d57d05 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2021 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
@@ -29,7 +29,7 @@ import (
 
        xdr "github.com/davecgh/go-xdr/xdr2"
        "github.com/klauspost/compress/zstd"
-       "go.cypherpunks.ru/nncp/v5"
+       "go.cypherpunks.ru/nncp/v6"
 )
 
 func usage() {
@@ -105,12 +105,14 @@ func main() {
                        payloadType = "file request"
                case nncp.PktTypeExec:
                        payloadType = "exec"
+               case nncp.PktTypeExecFat:
+                       payloadType = "exec uncompressed"
                case nncp.PktTypeTrns:
                        payloadType = "transitional"
                }
                var path string
                switch pkt.Type {
-               case nncp.PktTypeExec:
+               case nncp.PktTypeExec, nncp.PktTypeExecFat:
                        path = string(bytes.Replace(
                                pkt.Path[:pkt.PathLen],
                                []byte{0},
@@ -118,7 +120,7 @@ func main() {
                                -1,
                        ))
                case nncp.PktTypeTrns:
-                       path = nncp.ToBase32(pkt.Path[:pkt.PathLen])
+                       path = nncp.Base32Codec.EncodeToString(pkt.Path[:pkt.PathLen])
                default:
                        path = string(pkt.Path[:pkt.PathLen])
                }