MAKE_CTB(3)

NAME
make_ctb - make a CTB based on packet type

SYNOPSIS
#include <pgplib.h>
int
make_ctb(u_char type, u_long length, int force, u_char *buf);

DESCRIPTION
The length of the length of a PGP packet depends on the length of the data, and the type. Take a type, a length and a buffer (at least 5 bytes long) and write a CTB and the length (in network byte order) into the buffer. If force is non-zero the length of the length is set to 4 regardless of type.

RETURN VALUES
The number of bytes written into buf is returned. PGPlib(3)

HISTORY
Written by Tage Stabell-Kulų. First appeared in PGPlib 0.1. The idea was taken from write_ctb_len() in PGP/src/crypto.c