https://github.com/stefanha/nc-vsock/blob/master/nc-vsock.c
Skip to content Search or jump to… Pull requests Issues Marketplace Explore @magnate3 Learn Git and GitHub without any code! Using the Hello World guide, you’ll start a branch, write comments, and open a pull request. stefanha / nc-vsock 1 168 Code Issues Pull requests Actions Projects Wiki Security Insights nc-vsock/nc-vsock.c Stefan Hajnoczi nc-vsock: separate stdin and stdout file descriptors … Latest commit 884d89d on 29 Mar 2017 History 1 contributor 324 lines (278 sloc) 6.28 KB /* * nc-vsock - netcat-like utility for AF_VSOCK * Copyright (C) 2016 Stefan Hajnoczi <stefanha@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <errno.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <netdb.h> #include <linux/vm_sockets.h> static int parse_cid(const char *cid_str) { char *end = NULL; long cid = strtol(cid_str, &end, 10); if (cid_str != end && *end == '