Commit d45c80b3 authored by Niels Möller's avatar Niels Möller
Browse files

Files more or less empty and obsolete.

Rev: src/transport.c:1.4
Rev: src/transport.h:1.6
parent b2b01900
......@@ -5,19 +5,6 @@
#include "transport.h"
#include "xalloc.h"
struct lsh_string *lsh_string_alloc(UINT32 length)
{
struct lsh_string *packet
= xalloc(sizeof(struct lsh_string) - 1 + length);
packet->length = length;
return packet;
}
void lsh_string_free(struct lsh_string *packet)
{
free(packet);
}
#if 0
void simple_buffer_init(struct simple_buffer *buffer,
UINT32 capacity, UINT8 *data)
......
......@@ -8,21 +8,6 @@
#include "lsh_types.h"
/* Reads a 32-bit integer, in network byte order */
#define READ_UINT32(p) \
((((UINT32) (p)[0]) << 24) \
| (((UINT32) (p)[0]) << 16) \
| (((UINT32) (p)[0]) << 8) \
| ((UINT32) (p)[0]))
#define WRITE_UINT32(p, i) \
do { \
(p)[0] = ((i) >> 24) & 0xff; \
(p)[0] = ((i) >> 16) & 0xff; \
(p)[0] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
} while(0)
#if 0
struct ssh_packet
{
......@@ -32,58 +17,6 @@ struct ssh_packet
};
#endif
/* Allocation */
/* The memory allocation model is as follows:
*
* Packets are allocated when the are needed. A packet may be passed
* through a chain of processing functions, until it is finally
* discarded or transmitted, at which time it is deallocated.
* Processing functions may deallocate their input packets and
* allocate fresh packets to pass on; therefore, any data from a
* packet that is needed later must be copied into some other storage.
*
* At any time, each packet is own by a a particular processing
* function. Pointers into a packet are valid only while you own it.
* */
/* Size is the maximum amount of payload + padding that will be stored
* in the packet. */
struct lsh_string *lsh_string_alloc(UINT32 size);
void lsh_string_free(struct lsh_string *packet);
#if 0
/* A packet processing function.
*
* Typically, real processors will extend this struct, with fields
* such as the process parameters, next processor, output socket, etc.
* */
struct packet_processor; /* Forward declaration */
/* This function returns 0 if there's some fatal protocol error
* (implying immediate shutdown of (this direction of) a connection.
* Otherwise returns 1. */
typedef int (*raw_processor_function)(struct packet_processor *context,
struct lsh_string *packet);
struct packet_processor
{
raw_processor_function f;
};
int apply_processor(struct packet_processor *closure,
struct lsh_string *packet);
#endif
/* A processor that passes its result on to another processor */
struct abstract_write_pipe
{
struct abstract_write p;
struct abstract_write *next;
};
#if 0
/* error codes, returned from packet processors. zero means ok,
* negative means a fatal protocol failure, and positive values are
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment