Skip to content

Commit ace51c4

Browse files
committed
9p: add new protocol support code
This adds a new protocol processing support code based on Anthony Liguori's 9p library code. This code performs protocol marshalling/unmarshalling using printf like strings to represent protocol elements. It is my intent to use them to replace the current functions in conv.c as well as the p9_create_* functions. This should make the client implementation much more clear, and also make it much easier to add new protocol extensions by limiting the number of places in which changes need to be made. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
1 parent 6936bf6 commit ace51c4

4 files changed

Lines changed: 496 additions & 1 deletion

File tree

‎include/net/9p/9p.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ struct p9_rwstat {
509509
* @size: prefixed length of the structure
510510
* @id: protocol operating identifier of type &p9_msg_t
511511
* @tag: transaction id of the request
512+
* @offset: used by marshalling routines to track currentposition in buffer
513+
* @capacity: used by marshalling routines to track total capacity
512514
* @sdata: payload
513515
* @params: per-operation parameters
514516
*
@@ -523,7 +525,11 @@ struct p9_fcall {
523525
u32 size;
524526
u8 id;
525527
u16 tag;
526-
void *sdata;
528+
529+
size_t offset;
530+
size_t capacity;
531+
532+
uint8_t *sdata;
527533

528534
union {
529535
struct p9_tversion tversion;

‎net/9p/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
88
error.o \
99
fcprint.o \
1010
util.o \
11+
protocol.o \
1112
trans_fd.o \
1213

1314
9pnet_virtio-objs := \

0 commit comments

Comments
 (0)