From 15c01cbd4b1fabe929cb93226f6295e88b0c04c4 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 4 Jun 2023 08:25:12 +0200 Subject: demo: Start with a connect() example Signed-off-by: Stefano Brivio --- demo/connect.hjson | 13 +++++++++++++ demo/connect.hjson.license | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 demo/connect.hjson create mode 100644 demo/connect.hjson.license (limited to 'demo') diff --git a/demo/connect.hjson b/demo/connect.hjson new file mode 100644 index 0000000..91d5af1 --- /dev/null +++ b/demo/connect.hjson @@ -0,0 +1,13 @@ +[ + { + "match": [ + { "connect": { "addr": { "family": "unix", "path": "/var/run/pr-helper.sock" }, "fd": { "tag": "fd" } } } + ], + "call": [ + { "socket": { "family": "unix", "type": "stream", "flags": 0, "protocol": 0 }, "ret": "new_fd" }, + { "connect": { "fd": { "tag": { "get": "new_fd" } }, "addr": { "family": "unix", "path": "/tmp/demo.sock" } }, "ret": "y" } + ], + "fd": { "src": { "tag": "fd" }, "new": { "tag": "new_fd" }, "close_on_exec": false }, + "return": 0 + } +] diff --git a/demo/connect.hjson.license b/demo/connect.hjson.license new file mode 100644 index 0000000..d2abc50 --- /dev/null +++ b/demo/connect.hjson.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2023 Red Hat GmbH +SPDX-License-Identifier: GPL-2.0-or-later -- cgit v1.2.3