The packet-crafting Reference Manual

This is the packet-crafting Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 19:08:33 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 packet-crafting

A library to craft network packets.

Author

mets634 <>

License

MIT

Version

0.1.0

Dependency

lisp-binary (system).

Source

packet-crafting.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 packet-crafting/src

Source

packet-crafting.asd.

Parent Component

packet-crafting (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 packet-crafting/packet-crafting.asd

Source

packet-crafting.asd.

Parent Component

packet-crafting (system).

ASDF Systems

packet-crafting.


4.1.2 packet-crafting/src/bsl.lisp

Source

packet-crafting.asd.

Parent Component

src (module).

Packages

bsl.

Public Interface

deflayer (macro).

Internals

4.1.3 packet-crafting/src/layers.lisp

Source

packet-crafting.asd.

Parent Component

src (module).

Packages

layers.

Public Interface
Internals

4.1.4 packet-crafting/src/packet.lisp

Source

packet-crafting.asd.

Parent Component

src (module).

Packages

packet.

Public Interface
Internals

+default-packet-size+ (constant).


4.1.5 packet-crafting/src/main.lisp

Source

packet-crafting.asd.

Parent Component

src (module).

Packages

packet-crafting.

Public Interface

main (function).


5 Packages

Packages are listed by definition order.


5.1 layers

Source

layers.lisp.

Use List
  • bsl.
  • common-lisp.
Used By List
Public Interface
Internals

5.2 bsl

Source

bsl.lisp.

Use List
  • common-lisp.
  • lisp-binary.
Used By List

layers.

Public Interface

deflayer (macro).

Internals

5.3 packet

Source

packet.lisp.

Use List
Public Interface
Internals

+default-packet-size+ (constant).


5.4 packet-crafting

Source

main.lisp.

Use List
Public Interface

main (function).


6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Macros

Macro: deflayer (name &rest fields)

Creates a binary-structure (lisp-binary:defbinary) representing a network-layer with the specified fields.

Package

bsl.

Source

bsl.lisp.


6.1.2 Ordinary functions

Function: add-layer (packet &rest new-layers)

Adds new layers to a given packet, and extends the vector if needed.

Package

packet.

Source

packet.lisp.

Function: get-layer (packet index)

Returns a setf-able layer from a given packet.

Package

packet.

Source

packet.lisp.

Function: main (argv)
Package

packet-crafting.

Source

main.lisp.

Function: make-ethernet-ii (&key destination source type)
Package

layers.

Source

layers.lisp.

Function: make-ipv4 (&key version header-length type-of-service total-length identification flags fragment-offset time-to-live protocol header-checksum source-address destination-address)
Package

layers.

Source

layers.lisp.

Function: make-packet (&optional size)
Package

packet.

Source

packet.lisp.

Function: remove-layer (packet index)

Removes the layer of a given packet at a given index.

Package

packet.

Source

packet.lisp.

Function: show (packet &optional stream)

Prints a packet’s layers in order of appearance.

Package

packet.

Source

packet.lisp.


6.1.3 Standalone methods

Method: write-binary ((ipv4 ipv4) stream-symbol-1)
Package

lisp-binary.

Source

layers.lisp.

Method: write-binary ((ethernet-ii ethernet-ii) stream-symbol-1)
Package

lisp-binary.

Source

layers.lisp.


6.2 Internals


6.2.1 Constants

Constant: +default-packet-size+
Package

packet.

Source

packet.lisp.


6.2.2 Ordinary functions

Function: copy-ethernet-ii (instance)
Package

layers.

Source

layers.lisp.

Function: copy-ipv4 (instance)
Package

layers.

Source

layers.lisp.

Reader: ethernet-ii-destination (instance)
Writer: (setf ethernet-ii-destination) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

destination.

Function: ethernet-ii-p (object)
Package

layers.

Source

layers.lisp.

Reader: ethernet-ii-source (instance)
Writer: (setf ethernet-ii-source) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

source.

Reader: ethernet-ii-type (instance)
Writer: (setf ethernet-ii-type) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

type.

Function: field (bsl field-name)
Package

bsl.

Source

bsl.lisp.

Reader: ipv4-destination-address (instance)
Writer: (setf ipv4-destination-address) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

destination-address.

Reader: ipv4-flags (instance)
Writer: (setf ipv4-flags) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

flags.

Reader: ipv4-fragment-offset (instance)
Writer: (setf ipv4-fragment-offset) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

fragment-offset.

Reader: ipv4-header-checksum (instance)
Writer: (setf ipv4-header-checksum) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

header-checksum.

Reader: ipv4-header-length (instance)
Writer: (setf ipv4-header-length) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

header-length.

Reader: ipv4-identification (instance)
Writer: (setf ipv4-identification) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

identification.

Function: ipv4-p (object)
Package

layers.

Source

layers.lisp.

Reader: ipv4-protocol (instance)
Writer: (setf ipv4-protocol) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

protocol.

Reader: ipv4-source-address (instance)
Writer: (setf ipv4-source-address) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

source-address.

Reader: ipv4-time-to-live (instance)
Writer: (setf ipv4-time-to-live) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

time-to-live.

Reader: ipv4-total-length (instance)
Writer: (setf ipv4-total-length) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

total-length.

Reader: ipv4-type-of-service (instance)
Writer: (setf ipv4-type-of-service) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

type-of-service.

Reader: ipv4-version (instance)
Writer: (setf ipv4-version) (instance)
Package

layers.

Source

layers.lisp.

Target Slot

version.

Function: name (field)
Package

bsl.

Source

bsl.lisp.

Function: size (field)
Package

bsl.

Source

bsl.lisp.

Function: value (field)
Package

bsl.

Source

bsl.lisp.


6.2.3 Structures

Structure: ethernet-ii
Package

layers.

Source

layers.lisp.

Direct superclasses

structure-object.

Direct methods

write-binary.

Direct slots
Slot: destination
Type

(unsigned-byte 48)

Readers

ethernet-ii-destination.

Writers

(setf ethernet-ii-destination).

Slot: source
Type

(unsigned-byte 48)

Readers

ethernet-ii-source.

Writers

(setf ethernet-ii-source).

Slot: type
Package

common-lisp.

Type

(unsigned-byte 16)

Readers

ethernet-ii-type.

Writers

(setf ethernet-ii-type).

Structure: ipv4
Package

layers.

Source

layers.lisp.

Direct superclasses

structure-object.

Direct methods

write-binary.

Direct slots
Slot: version
Type

(unsigned-byte 4)

Readers

ipv4-version.

Writers

(setf ipv4-version).

Slot: header-length
Type

(unsigned-byte 4)

Readers

ipv4-header-length.

Writers

(setf ipv4-header-length).

Slot: type-of-service
Type

(unsigned-byte 8)

Readers

ipv4-type-of-service.

Writers

(setf ipv4-type-of-service).

Slot: total-length
Type

(unsigned-byte 16)

Readers

ipv4-total-length.

Writers

(setf ipv4-total-length).

Slot: identification
Type

(unsigned-byte 16)

Readers

ipv4-identification.

Writers

(setf ipv4-identification).

Slot: flags
Type

(unsigned-byte 3)

Readers

ipv4-flags.

Writers

(setf ipv4-flags).

Slot: fragment-offset
Type

(unsigned-byte 13)

Readers

ipv4-fragment-offset.

Writers

(setf ipv4-fragment-offset).

Slot: time-to-live
Type

(unsigned-byte 8)

Readers

ipv4-time-to-live.

Writers

(setf ipv4-time-to-live).

Slot: protocol
Type

(unsigned-byte 8)

Readers

ipv4-protocol.

Writers

(setf ipv4-protocol).

Slot: header-checksum
Type

(unsigned-byte 16)

Readers

ipv4-header-checksum.

Writers

(setf ipv4-header-checksum).

Slot: source-address
Type

(unsigned-byte 32)

Readers

ipv4-source-address.

Writers

(setf ipv4-source-address).

Slot: destination-address
Type

(unsigned-byte 32)

Readers

ipv4-destination-address.

Writers

(setf ipv4-destination-address).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   E   F   G   I   M   N   R   S   V   W  
Index Entry  Section

(
(setf ethernet-ii-destination): Private ordinary functions
(setf ethernet-ii-source): Private ordinary functions
(setf ethernet-ii-type): Private ordinary functions
(setf ipv4-destination-address): Private ordinary functions
(setf ipv4-flags): Private ordinary functions
(setf ipv4-fragment-offset): Private ordinary functions
(setf ipv4-header-checksum): Private ordinary functions
(setf ipv4-header-length): Private ordinary functions
(setf ipv4-identification): Private ordinary functions
(setf ipv4-protocol): Private ordinary functions
(setf ipv4-source-address): Private ordinary functions
(setf ipv4-time-to-live): Private ordinary functions
(setf ipv4-total-length): Private ordinary functions
(setf ipv4-type-of-service): Private ordinary functions
(setf ipv4-version): Private ordinary functions

A
add-layer: Public ordinary functions

C
copy-ethernet-ii: Private ordinary functions
copy-ipv4: Private ordinary functions

D
deflayer: Public macros

E
ethernet-ii-destination: Private ordinary functions
ethernet-ii-p: Private ordinary functions
ethernet-ii-source: Private ordinary functions
ethernet-ii-type: Private ordinary functions

F
field: Private ordinary functions
Function, (setf ethernet-ii-destination): Private ordinary functions
Function, (setf ethernet-ii-source): Private ordinary functions
Function, (setf ethernet-ii-type): Private ordinary functions
Function, (setf ipv4-destination-address): Private ordinary functions
Function, (setf ipv4-flags): Private ordinary functions
Function, (setf ipv4-fragment-offset): Private ordinary functions
Function, (setf ipv4-header-checksum): Private ordinary functions
Function, (setf ipv4-header-length): Private ordinary functions
Function, (setf ipv4-identification): Private ordinary functions
Function, (setf ipv4-protocol): Private ordinary functions
Function, (setf ipv4-source-address): Private ordinary functions
Function, (setf ipv4-time-to-live): Private ordinary functions
Function, (setf ipv4-total-length): Private ordinary functions
Function, (setf ipv4-type-of-service): Private ordinary functions
Function, (setf ipv4-version): Private ordinary functions
Function, add-layer: Public ordinary functions
Function, copy-ethernet-ii: Private ordinary functions
Function, copy-ipv4: Private ordinary functions
Function, ethernet-ii-destination: Private ordinary functions
Function, ethernet-ii-p: Private ordinary functions
Function, ethernet-ii-source: Private ordinary functions
Function, ethernet-ii-type: Private ordinary functions
Function, field: Private ordinary functions
Function, get-layer: Public ordinary functions
Function, ipv4-destination-address: Private ordinary functions
Function, ipv4-flags: Private ordinary functions
Function, ipv4-fragment-offset: Private ordinary functions
Function, ipv4-header-checksum: Private ordinary functions
Function, ipv4-header-length: Private ordinary functions
Function, ipv4-identification: Private ordinary functions
Function, ipv4-p: Private ordinary functions
Function, ipv4-protocol: Private ordinary functions
Function, ipv4-source-address: Private ordinary functions
Function, ipv4-time-to-live: Private ordinary functions
Function, ipv4-total-length: Private ordinary functions
Function, ipv4-type-of-service: Private ordinary functions
Function, ipv4-version: Private ordinary functions
Function, main: Public ordinary functions
Function, make-ethernet-ii: Public ordinary functions
Function, make-ipv4: Public ordinary functions
Function, make-packet: Public ordinary functions
Function, name: Private ordinary functions
Function, remove-layer: Public ordinary functions
Function, show: Public ordinary functions
Function, size: Private ordinary functions
Function, value: Private ordinary functions

G
get-layer: Public ordinary functions

I
ipv4-destination-address: Private ordinary functions
ipv4-flags: Private ordinary functions
ipv4-fragment-offset: Private ordinary functions
ipv4-header-checksum: Private ordinary functions
ipv4-header-length: Private ordinary functions
ipv4-identification: Private ordinary functions
ipv4-p: Private ordinary functions
ipv4-protocol: Private ordinary functions
ipv4-source-address: Private ordinary functions
ipv4-time-to-live: Private ordinary functions
ipv4-total-length: Private ordinary functions
ipv4-type-of-service: Private ordinary functions
ipv4-version: Private ordinary functions

M
Macro, deflayer: Public macros
main: Public ordinary functions
make-ethernet-ii: Public ordinary functions
make-ipv4: Public ordinary functions
make-packet: Public ordinary functions
Method, write-binary: Public standalone methods
Method, write-binary: Public standalone methods

N
name: Private ordinary functions

R
remove-layer: Public ordinary functions

S
show: Public ordinary functions
size: Private ordinary functions

V
value: Private ordinary functions

W
write-binary: Public standalone methods
write-binary: Public standalone methods