Comparing version 0.0.20200606 to 0.0.20200909
export declare const TT: { | ||
LpPacket: number; | ||
Fragment: number; | ||
LpPayload: number; | ||
LpSeqNum: number; | ||
FragIndex: number; | ||
FragCount: number; | ||
PitToken: number; | ||
Nack: number; | ||
NackReason: number; | ||
CongestionMark: number; | ||
}; |
import { NackHeader } from "@ndn/packet"; | ||
import { Decoder, Encoder } from "@ndn/tlv"; | ||
import { PitToken } from "./mod"; | ||
import { Decoder, Encodable, Encoder } from "@ndn/tlv"; | ||
import type { PitToken } from "./pit-token"; | ||
/** NDNLPv2 packet. */ | ||
export declare class LpPacket { | ||
static decodeFrom(decoder: Decoder): LpPacket; | ||
fragSeqNum?: bigint; | ||
fragIndex: number; | ||
fragCount: number; | ||
pitToken?: PitToken; | ||
nack?: NackHeader; | ||
fragment?: Uint8Array; | ||
payload?: Uint8Array; | ||
encodeTo(encoder: Encoder): void; | ||
encodeL3Headers(): Encodable[]; | ||
copyL3HeadersFrom(src: LpPacket): void; | ||
} |
@@ -1,10 +0,3 @@ | ||
import { LpService } from "./service"; | ||
/** PIT token field of NDNLP packet. */ | ||
export declare type PitToken = Uint8Array; | ||
export declare namespace PitToken { | ||
/** Retrieve PIT token of L3 packet. */ | ||
function get(pkt: LpService.L3Pkt): PitToken | undefined; | ||
/** Store PIT token of L3 packet. */ | ||
function set(pkt: LpService.L3Pkt, token?: PitToken): void; | ||
} | ||
/** PIT tokens in a 32-bit numeric range. */ | ||
@@ -14,4 +7,4 @@ export declare class NumericPitToken { | ||
constructor(prefix?: number); | ||
get(pkt: LpService.L3Pkt): number | undefined; | ||
set(pkt: LpService.L3Pkt, suffix: number): number; | ||
toNumber(token?: PitToken): number | undefined; | ||
toToken(suffix: number): PitToken; | ||
} |
import { Data, Interest, Nack } from "@ndn/packet"; | ||
import { Decoder } from "@ndn/tlv"; | ||
export declare class LpService { | ||
constructor({ keepAlive, }?: LpService.Options); | ||
private keepAlive; | ||
rx: (iterable: AsyncIterable<Decoder.Tlv>) => AsyncIterable<Data | Interest | Nack | LpService.RxError>; | ||
constructor({ keepAlive, mtu, reassemblerCapacity, }?: LpService.Options); | ||
private readonly keepAlive; | ||
private readonly mtu; | ||
private readonly fragmenter?; | ||
private readonly reassembler; | ||
rx: (iterable: AsyncIterable<Decoder.Tlv>) => AsyncIterable<LpService.Packet | LpService.RxError>; | ||
private rx_; | ||
private decode; | ||
private decodeL3; | ||
tx: (iterable: AsyncIterable<LpService.L3Pkt>) => AsyncIterable<Uint8Array | LpService.TxError>; | ||
tx: (iterable: AsyncIterable<LpService.Packet>) => AsyncIterable<Uint8Array | LpService.TxError>; | ||
private tx_; | ||
@@ -15,3 +18,3 @@ private encode; | ||
export declare namespace LpService { | ||
interface Options { | ||
export interface Options { | ||
/** | ||
@@ -23,12 +26,28 @@ * How often to send IDLE packets if nothing else was sent, in millis. | ||
keepAlive?: false | number; | ||
/** | ||
* MTU for fragmentation. | ||
* Set Infinity to disable fragmentation. | ||
* @default Infinity | ||
*/ | ||
mtu?: number; | ||
/** | ||
* Maximum number of partial packets kept in the reassembler. | ||
* @default 16 | ||
*/ | ||
reassemblerCapacity?: number; | ||
} | ||
type L3Pkt = Interest | Data | Nack; | ||
class RxError extends Error { | ||
export interface Packet { | ||
l3: L3Pkt; | ||
token?: Uint8Array; | ||
} | ||
export class RxError extends Error { | ||
readonly packet: Uint8Array; | ||
constructor(inner: Error, packet: Uint8Array); | ||
} | ||
class TxError extends Error { | ||
export class TxError extends Error { | ||
readonly packet: L3Pkt; | ||
constructor(inner: Error, packet: L3Pkt); | ||
} | ||
export {}; | ||
} |
{ | ||
"name": "@ndn/lp", | ||
"version": "0.0.20200606", | ||
"version": "0.0.20200909", | ||
"description": "NDNts: NDNLP", | ||
@@ -15,3 +15,4 @@ "keywords": [ | ||
"type": "module", | ||
"main": "lib/mod.js", | ||
"main": "lib/mod_node.js", | ||
"module": "lib/mod_browser.js", | ||
"sideEffects": false, | ||
@@ -25,7 +26,8 @@ "homepage": "https://yoursunny.com/p/NDNts/", | ||
"dependencies": { | ||
"@ndn/packet": "0.0.20200606", | ||
"@ndn/tlv": "0.0.20200606", | ||
"@ndn/packet": "0.0.20200909", | ||
"@ndn/tlv": "0.0.20200909", | ||
"it-keepalive": "^1.2.0", | ||
"tslib": "*" | ||
} | ||
"tslib": "^2.0.1" | ||
}, | ||
"types": "lib/mod.d.ts" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29403
23
841
1
+ Added@ndn/packet@0.0.20200909(transitive)
+ Added@ndn/tlv@0.0.20200909(transitive)
- Removed@ndn/packet@0.0.20200606(transitive)
- Removed@ndn/tlv@0.0.20200606(transitive)
Updated@ndn/packet@0.0.20200909
Updated@ndn/tlv@0.0.20200909
Updatedtslib@^2.0.1