/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2019 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
xdr "github.com/davecgh/go-xdr/xdr2"
"github.com/klauspost/compress/zstd"
- "go.cypherpunks.ru/nncp/v5"
+ "go.cypherpunks.ru/nncp/v7"
)
func usage() {
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
+ log.SetFlags(log.Lshortfile)
flag.Usage = usage
flag.Parse()
if *warranty {
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},
-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])
}
}
var pktEnc nncp.PktEnc
_, err = xdr.Unmarshal(bytes.NewReader(beginning), &pktEnc)
- if err == nil && pktEnc.Magic == nncp.MagicNNCPEv4 {
+ if err == nil && pktEnc.Magic == nncp.MagicNNCPEv5 {
if *dump {
ctx, err := nncp.CtxFromCmdline(*cfgPath, "", "", false, false, false, false)
if err != nil {