5 * 9P network filesystem protocol
7 * by Daniel Mendler <mail@daniel-mendler.de>
11 * - Documentation: http://9p.cat-v.org/
12 * - List of implementations: http://9p.cat-v.org/implementations
13 * - Specification: http://ericvh.github.io/9p-rfc/
14 * - Linux documentation: https://www.kernel.org/doc/Documentation/filesystems/9p.txt
18 * 1. Add "network.plan9.enable true" to the config
19 * 2. Mount under Linux with "mount -t 9p $ip /mnt/smoothie
38 static void appcall();
46 : type(t
), refcount(0) {}
49 typedef std::map
<std::string
, EntryData
> EntryMap
;
50 typedef EntryMap::value_type
* Entry
;
51 typedef std::map
<uint32_t, Entry
> FidMap
;
57 bool process(Message
*, Message
*);
59 Entry
add_entry(uint32_t, uint8_t, const std::string
&);
60 Entry
get_entry(uint32_t);
61 bool add_fid(uint32_t, Entry
);
62 void remove_fid(uint32_t);
64 static const uint32_t INITIAL_MSIZE
= 300;
68 char bufin
[INITIAL_MSIZE
], bufout
[INITIAL_MSIZE
];
69 std::queue
<Message
*> queue
;
70 uint32_t msize
, queue_bytes
;