← All procedures

algebra.udpFrameLength

This function gives the qdisc length of one UDP datagram of `payload` bytes on an Ethernet device or a veth. It adds the Ethernet header of 14 bytes, the IP header and the UDP header of 8 bytes. The IP header is 20 bytes for IPv4 and 40 bytes for IPv6, with no options.

CLI
Package
@procedures/algebra · README
Path
["algebra","udpFrameLength"]
CLI
mark algebra udpFrameLength --payload <number>
As data
{"$proc":["algebra","udpFrameLength"],"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","udpFrameLength"], { payload: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark algebra udpFrameLength --payload <number>

As data, in a program

{ "$proc": ["algebra", "udpFrameLength"], "input": { "payload": 1 } }

Input

FieldTypeRequiredDefaultDescription
payloadnumberyes
familynumber | numberno

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "payload": {
        "type": "number"
      },
      "family": {
        "anyOf": [
          {
            "type": "number",
            "const": 4
          },
          {
            "type": "number",
            "const": 6
          }
        ]
      }
    },
    "required": [
      "payload"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}