← All procedures

algebra.fifoDefaultLimit

This function gives the limit of a pfifo or a bfifo with no limit of its own (`net/sched/sch_fifo.c`, lines 106-112). A pfifo holds `txqueuelen` packets. A bfifo holds `txqueuelen` times the MTU plus the link header, in bytes (`psched_mtu`, `include/net/pkt_sched.h`, lines 131-134). A pfifo drops a packet when it holds its limit. A bfifo drops a packet that puts its bytes above its limit (lines 19-36).

CLI
Package
@procedures/algebra · README
Path
["algebra","fifoDefaultLimit"]
CLI
mark algebra fifoDefaultLimit --kind <"bfifo" | "pfifo"> --txQueueLen <number> --mtu <number>
As data
{"$proc":["algebra","fifoDefaultLimit"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","fifoDefaultLimit"], { kind: "bfifo", txQueueLen: 1, mtu: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark algebra fifoDefaultLimit --kind <"bfifo" | "pfifo"> --txQueueLen <number> --mtu <number>

As data, in a program

{
  "$proc": ["algebra", "fifoDefaultLimit"],
  "input": { "kind": "bfifo", "txQueueLen": 1, "mtu": 1 }
}

Input

FieldTypeRequiredDefaultDescription
kind"bfifo" | "pfifo"yes
txQueueLennumberyes
mtunumberyes
hardHeaderLennumberno

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "kind": {
        "type": "string",
        "enum": [
          "bfifo",
          "pfifo"
        ]
      },
      "txQueueLen": {
        "type": "number"
      },
      "mtu": {
        "type": "number"
      },
      "hardHeaderLen": {
        "type": "number"
      }
    },
    "required": [
      "kind",
      "txQueueLen",
      "mtu"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}