search for: sockaddrandlen

Displaying 20 results from an estimated 50 matches for "sockaddrandlen".

2020 Sep 29
2
[PATCH libnbd] generator: Add SizeT type, maps to C size_t.
...l | 11 +++++++++-- 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/generator/API.ml b/generator/API.ml index 0a876c4..b93580d 100644 --- a/generator/API.ml +++ b/generator/API.ml @@ -47,6 +47,7 @@ and arg = | Int of string | Int64 of string | Path of string +| SizeT of string | SockAddrAndLen of string * string | String of string | StringList of string diff --git a/generator/API.mli b/generator/API.mli index 9d2fdb7..2e7aa78 100644 --- a/generator/API.mli +++ b/generator/API.mli @@ -57,6 +57,7 @@ and arg = | Int of string (** small int *) | Int64 of string (** 64...
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
...9,7 @@ let print_python_binding name { args; ret } = (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ - | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ + | Flags _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> assert false ) args; pr "\n"; @@ -3278,13 +3279,14 @@ let print_python_binding name { args; ret } = function | ArrayAndLen (UIn...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...tor/generator +++ b/generator/generator @@ -845,6 +845,7 @@ and arg = | Int64 of string (* 64 bit signed int *) | Opaque of string (* opaque object, void* in C *) | Path of string (* filename or path *) +| ReadStatus of string (* enum of pread_callback status *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) | StringList of string (* argv-style NULL-terminated array of strings *) @@ -2033,10 +2034,13 @@ let constants = [ "CMD_FLAG_NO_HOLE", 1 lsl 1; "CMD_FLAG_DF", 1...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...(* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) +| Mutable of arg (* mutable argument, eg. int* *) | Opaque of string (* opaque object, void* in C *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) @@ -2708,6 +2709,7 @@ let rec name_of_arg = function | Int n -> [n] | Int64 n -> [n] | Opaque n -> [n] +| Mutable arg -> name_of_arg arg | Path n -> [n] | SockAddrAndLen (n, len) -> [n; len] | String n -> [n] @@ -2741...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...generator > @@ -845,6 +845,7 @@ and arg = > | Int64 of string (* 64 bit signed int *) > | Opaque of string (* opaque object, void* in C *) > | Path of string (* filename or path *) > +| ReadStatus of string (* enum of pread_callback status *) > | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) > | String of string (* string *) > | StringList of string (* argv-style NULL-terminated array of strings *) > @@ -2033,10 +2034,13 @@ let constants = [ > "CMD_FLAG_NO_HOLE", 1 lsl 1; > "CMD_...
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...er, @@ -858,7 +857,6 @@ and arg = | Flags of string (* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) -| Mutable of arg (* mutable argument, eg. int* *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string, cannot be NULL *) @@ -866,10 +864,6 @@ and arg = | UInt of string (* small unsigned int *) | UInt32 of string (* 32 bit unsigned int *) | UInt64 of string (* 64 bit unsigned in...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...8,7 @@ let print_python_binding name { args; ret } = (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ - | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ + | Flags _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> assert false ) args; pr "\n"; @@ -3282,13 +3368,14 @@ let print_python_binding name { args; ret } = function | ArrayAndLen (UIn...
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
...-3525,7 +3526,7 @@ let print_python_binding name { args; ret } = | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ - | Flags _ | Int64 _ | Mutable _ + | Flags _ | Mutable _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> assert false ) args; @@ -3537,6 +3538,7 @@ let print_python_binding name { args; ret } = | ArrayAndLen (UInt32 n, len) -> pr " \"O\"" | BytesIn (n, len) -> pr " \"y#\""...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...one or more callbacks + * sharing same opaque *) +| OpaqueAndCallbacksPersist of string * callback list (* as above, but opaque + * persists *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) @@ -915,9 +923,10 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with - args = [ Opaque "data"; - CallbackPe...
2019 Jul 24
0
[PATCH libnbd v2 5/5] lib: Use unsigned for pread_structured status parameter.
..._ + | UInt _ + | UInt64 _ -> () (* The following not yet implemented for callbacks XXX *) | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Closure _ | Flags _ | Mutable _ | Path _ | SockAddrAndLen _ | StringList _ - | UInt _ | UInt32 _ -> assert false + | UInt32 _ -> assert false ) cbargs; pr "\n"; @@ -3820,6 +3821,7 @@ let print_python_binding name { args; ret } = | Int64 n -> pr " \"L\"" | Mu...
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...hon_binding name { args; ret } = > (* The following not yet implemented for callbacks XXX *) > | ArrayAndLen _ | Bool _ | BytesOut _ > | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ > - | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ > + | Flags _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ > | UInt _ | UInt32 _ -> assert false > ) args; > pr "\n"; > @@ -3282,13 +3368,14 @@ let print_python_binding name { args; ret } = > functio...
2019 Jun 27
1
[libnbd PATCH] python: Fix bindings for Path parameters
...| Mutable arg -> pr " PyObject *%s;\n" (List.hd (name_of_arg arg)) | Opaque _ -> () - | Path n -> pr " char *%s = NULL;\n" n + | Path n -> + pr " PyObject *py_%s = NULL;\n" n; + pr " char *%s = NULL;\n" n | SockAddrAndLen (n, _) -> pr " /* XXX Complicated - Python uses a tuple of different\n"; pr " * lengths for the different socket types.\n"; @@ -3699,7 +3701,7 @@ let print_python_binding name { args; ret } = | Int64 n -> pr ", &%s" n | Mutable ar...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably make much sense on their own, but they are preparatory to better handling of enums, and or'd lists of flags. Rich.
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after
2019 Oct 04
0
[PATCH libnbd 3/4] api: Add nbd_connect_socket.
...t;" cbname | Enum (n, _) -> pr " %s=%%d" n | Flags (n, _) -> pr " %s=0x%%x" n - | Int n -> pr " %s=%%d" n + | Fd n | Int n -> pr " %s=%%d" n | Int64 n -> pr " %s=%%\" PRIi64 \"" n | SockAddrAndLen (n, len) -> pr " %s=<sockaddr> %s=%%d" n len | Path n @@ -4376,7 +4414,7 @@ let generate_lib_api_c () = | Closure { cbname } -> () | Enum (n, _) -> pr ", %s" n | Flags (n, _) -> pr ", %s" n - | Int n -> pr ", %...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...(* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) | Int64 of string (* 64 bit signed int *) | Mutable of arg (* mutable argument, eg. int* *) -| Opaque of string (* opaque object, void* in C *) | Path of string (* filename or path *) | SockAddrAndLen of string * string (* struct sockaddr * + socklen_t *) | String of string (* string *) @@ -863,6 +864,10 @@ and arg = | UInt of string (* small unsigned int *) | UInt32 of string (* 32 bit unsigned int *) | UInt64 of string (* 64 bit unsigned int *) +and closur...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...-> pr " %s=<buf> %s=%%zu" n count | Closure { cbname } -> pr " %s=<fun>" cbname - | Flags n -> pr " %s=0x%%x" n | Int n -> pr " %s=%%d" n | Int64 n -> pr " %s=%%\" PRIi64 \"" n | SockAddrAndLen (n, len) -> pr " %s=<sockaddr> %s=%%d" n len @@ -3670,6 +3684,10 @@ let generate_lib_api_c () = | UInt32 n -> pr " %s=%%\" PRIu32 \"" n | UInt64 n -> pr " %s=%%\" PRIu64 \"" n ) args; + List.iter ( + functio...
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...(* The following not yet implemented for callbacks XXX *) - | ArrayAndLen _ | Bool _ | BytesIn _ | BytesOut _ + | ArrayAndLen _ | Bool _ | BytesOut _ | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _ | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> assert false @@ -3173,11 +3203,12 @@ let print_python_binding name { args; ret } = List.iter ( function | ArrayAndLen (UInt32 n, len) -> pr " \"O\"" + | BytesIn (n, len) -> pr " \...