Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ndn/lp

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndn/lp - npm Package Compare versions

Comparing version 0.0.20200606 to 0.0.20200909

lib/an_browser.js

8

lib/an.d.ts
export declare const TT: {
LpPacket: number;
Fragment: number;
LpPayload: number;
LpSeqNum: number;
FragIndex: number;
FragCount: number;
PitToken: number;
Nack: number;
NackReason: number;
CongestionMark: number;
};

12

lib/packet.d.ts
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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc