README refined
This commit is contained in:
parent
81756b45dd
commit
6eea614d6c
46
README
46
README
@ -1,30 +1,28 @@
|
|||||||
libndbuf: Network designed buffer ops library
|
libndbuf: Network-oriented buffer operations library
|
||||||
----------------------------------------------
|
----------------------------------------------------
|
||||||
|
|
||||||
1. What the shit is that ?
|
1. What is it?
|
||||||
This is a quite small library to manipulate with binary packed buffers
|
A small C library providing a simple API to read and write typed values
|
||||||
in a normal network manner (i.e. bigendian). It might be useful to
|
to/from buffers with correct endianness handling.
|
||||||
apply for network packet creating/parsing.
|
|
||||||
Anyway, originally this code was resided in my different other *small*
|
|
||||||
projects - and i hate copy-paste -- well, that's why it gone to
|
|
||||||
this quite small library.
|
|
||||||
|
|
||||||
2. API
|
2. Purpose
|
||||||
Check out include directory...
|
Make parsing and building network packets easy and concise. The API is
|
||||||
btw, might be later i will write manpages, but for now didn't see any
|
intended to act like a binary printf/scanf for packet fields.
|
||||||
sense for those effort.
|
|
||||||
Generally speaking - all is quite simple - create ndbuf_t structure fill
|
Example:
|
||||||
it in printf() style, read with sscanf() style, take raw data pointer and ...
|
|
||||||
send it somewhere whatever bla bla - you get a point.
|
Packet layout:
|
||||||
|
<16-bit><8-bit><32-bit><raw data>
|
||||||
|
|
||||||
|
Reading with a single call:
|
||||||
|
ndbuf_escan(buf, "wbdR", &a16, &a8, &a32, &data_ptr)
|
||||||
|
|
||||||
|
The same style is used to build packets.
|
||||||
|
|
||||||
3. Future plans
|
3. Future plans
|
||||||
Fix bugs (but ... there are no bugs found, since this code was heavly used
|
* Improve the API ergonomics (better support for preallocated buffers).
|
||||||
already, but ... report me if found).
|
* Add convenience helpers and safer bounds checks.
|
||||||
Write manpages (in my few projects those API is like a part of POSIX -
|
* Possibly extend format specifiers and documentation.
|
||||||
still cannot remember all).
|
|
||||||
Maybe will add a new functions (useful ones).
|
|
||||||
|
|
||||||
4. Contact
|
4. Contact
|
||||||
That's simple -
|
Email: alex@vapaa.xyz
|
||||||
Email/XMPP: alex@vapaa.xyz
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user