2017-11-01 21:38:22 +01:00
|
|
|
/****************************************************************************
|
2021-06-16 10:32:24 +02:00
|
|
|
* apps/wireless/ieee802154/i8shark/i8shark_main.c
|
2017-11-01 21:38:22 +01:00
|
|
|
*
|
2022-03-07 15:05:57 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2017-11-01 21:38:22 +01:00
|
|
|
*
|
2022-03-07 15:05:57 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2017-11-01 21:38:22 +01:00
|
|
|
*
|
2022-03-07 15:05:57 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2017-11-01 21:38:22 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
2018-03-14 14:59:35 +01:00
|
|
|
#include <time.h>
|
2017-11-01 21:38:22 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
#include <nuttx/fs/ioctl.h>
|
|
|
|
#include <nuttx/wireless/ieee802154/ieee802154_mac.h>
|
|
|
|
#include <nuttx/wireless/ieee802154/ieee802154_device.h>
|
|
|
|
|
|
|
|
#include "netutils/netlib.h"
|
|
|
|
#include "wireless/ieee802154.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef CONFIG_IEEE802154_I8SHARK_DAEMON_PRIORITY
|
|
|
|
# define CONFIG_IEEE802154_I8SHARK_DAEMON_PRIORITY SCHED_PRIORITY_DEFAULT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_IEEE802154_I8SHARK_DAEMON_STACKSIZE
|
|
|
|
# define CONFIG_IEEE802154_I8SHARK_DAEMON_STACKSIZE 2048
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_IEEE802154_I8SHARK_CHANNEL
|
|
|
|
# define CONFIG_IEEE802154_I8SHARK_CHANNEL 11
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_IEEE802154_I8SHARK_HOST_IPADDR
|
|
|
|
# error "You must define CONFIG_IEEE802154_I8SHARK_HOST_IPADDR"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_IEEE802154_I8SHARK_FORWARDING_IFNAME
|
|
|
|
# define CONFIG_IEEE802154_I8SHARK_FORWARDING_IFNAME "eth0"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define I8SHARK_MAX_DEVPATH 15
|
|
|
|
|
|
|
|
#define ZEP_MAX_HDRSIZE 32
|
|
|
|
#define I8SHARK_MAX_ZEPFRAME IEEE802154_MAX_PHY_PACKET_SIZE + ZEP_MAX_HDRSIZE
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
struct i8shark_state_s
|
|
|
|
{
|
|
|
|
bool initialized : 1;
|
|
|
|
bool daemon_started : 1;
|
|
|
|
bool daemon_shutdown : 1;
|
|
|
|
|
|
|
|
pid_t daemon_pid;
|
|
|
|
|
|
|
|
/* User exposed settings */
|
|
|
|
|
|
|
|
FAR char devpath[I8SHARK_MAX_DEVPATH];
|
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int i8shark_init(FAR struct i8shark_state_s *i8shark);
|
|
|
|
static int i8shark_daemon(int argc, FAR char *argv[]);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static struct i8shark_state_s g_i8shark;
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: i8shark_init
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int i8shark_init(FAR struct i8shark_state_s *i8shark)
|
|
|
|
{
|
|
|
|
if (i8shark->initialized)
|
|
|
|
{
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the default settings using config options */
|
|
|
|
|
2023-02-09 12:01:32 +01:00
|
|
|
strlcpy(i8shark->devpath, CONFIG_IEEE802154_I8SHARK_DEVPATH,
|
|
|
|
sizeof(i8shark->devpath));
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Flags for synchronzing with daemon state */
|
|
|
|
|
|
|
|
i8shark->daemon_started = false;
|
|
|
|
i8shark->daemon_shutdown = false;
|
|
|
|
i8shark->initialized = true;
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name : i8shark_daemon
|
|
|
|
*
|
|
|
|
* Description :
|
2022-03-07 16:11:14 +01:00
|
|
|
* This daemon reads all incoming IEEE 802.15.4 frames from a MAC802154
|
|
|
|
* character driver, packages the frames into a Wireshark Zigbee
|
|
|
|
* Encapsulate Protocol (ZEP) packet and sends it over Ethernet to the
|
|
|
|
* specified host machine running Wireshark.
|
2017-11-01 21:38:22 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int i8shark_daemon(int argc, FAR char *argv[])
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
int fd;
|
|
|
|
struct sockaddr_in addr;
|
|
|
|
struct sockaddr_in raddr;
|
|
|
|
socklen_t addrlen;
|
|
|
|
int sockfd;
|
|
|
|
|
|
|
|
fprintf(stderr, "i8shark: daemon started\n");
|
|
|
|
g_i8shark.daemon_started = true;
|
|
|
|
|
|
|
|
fd = open(g_i8shark.devpath, O_RDWR);
|
|
|
|
if (fd < 0)
|
|
|
|
{
|
2022-03-07 16:11:14 +01:00
|
|
|
fprintf(stderr,
|
|
|
|
"ERROR: cannot open %s, errno=%d\n",
|
|
|
|
g_i8shark.devpath, errno);
|
2017-11-01 21:38:22 +01:00
|
|
|
g_i8shark.daemon_started = false;
|
|
|
|
ret = errno;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Place the MAC into promiscuous mode */
|
|
|
|
|
|
|
|
ieee802154_setpromisc(fd, true);
|
|
|
|
|
|
|
|
/* Always listen */
|
|
|
|
|
|
|
|
ieee802154_setrxonidle(fd, true);
|
|
|
|
|
|
|
|
/* Create a UDP socket to send the data to Wireshark */
|
|
|
|
|
|
|
|
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
|
|
|
if (sockfd < 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "ERROR: socket failure %d\n", errno);
|
|
|
|
g_i8shark.daemon_started = false;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* We bind to the IP address of the outbound interface so that
|
|
|
|
* the OS knows which interface to use to send the packet.
|
2017-11-01 21:38:22 +01:00
|
|
|
*/
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
netlib_get_ipv4addr(CONFIG_IEEE802154_I8SHARK_FORWARDING_IFNAME,
|
|
|
|
&addr.sin_addr);
|
2017-11-01 21:38:22 +01:00
|
|
|
addr.sin_port = 0;
|
|
|
|
addr.sin_family = AF_INET;
|
|
|
|
addrlen = sizeof(struct sockaddr_in);
|
|
|
|
|
|
|
|
if (bind(sockfd, (FAR struct sockaddr *)&addr, addrlen) < 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "ERROR: Bind failure: %d\n", errno);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Setup our remote address.
|
|
|
|
* Wireshark expects ZEP packets over UDP on port 17754
|
|
|
|
*/
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
raddr.sin_family = AF_INET;
|
|
|
|
raddr.sin_port = HTONS(17754);
|
|
|
|
raddr.sin_addr.s_addr = HTONL(CONFIG_IEEE802154_I8SHARK_HOST_IPADDR);
|
|
|
|
|
|
|
|
/* Loop until the daemon is shutdown reading incoming IEEE 802.15.4 frames,
|
2022-03-07 16:11:14 +01:00
|
|
|
* packing them into Wireshark "Zigbee Encapsulation Packets" (ZEP)
|
|
|
|
* and sending them over UDP to Wireshark.
|
2017-11-01 21:38:22 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
while (!g_i8shark.daemon_shutdown)
|
|
|
|
{
|
|
|
|
struct mac802154dev_rxframe_s frame;
|
|
|
|
enum ieee802154_frametype_e ftype;
|
|
|
|
uint8_t zepframe[I8SHARK_MAX_ZEPFRAME];
|
2018-03-14 14:59:35 +01:00
|
|
|
clock_t systime;
|
2019-08-10 20:26:33 +02:00
|
|
|
int i = 0;
|
2017-11-01 21:38:22 +01:00
|
|
|
int nbytes;
|
|
|
|
|
|
|
|
/* Get an incoming frame from the MAC character driver */
|
|
|
|
|
|
|
|
ret = read(fd, &frame, sizeof(struct mac802154dev_rxframe_s));
|
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* First 2 bytes of packet represent preamble. For ZEP, "EX" */
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = 'E';
|
|
|
|
zepframe[i++] = 'X';
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* The next byte is the version. We are using V2 */
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = 2;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Next byte is type. ZEP only differentiates between ACK and Data. My
|
|
|
|
* assumption is that Data also includes MAC command frames and beacon
|
|
|
|
* frames. So we really only need to check if it's an ACK or not.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ftype = ((*(uint16_t *)frame.payload) & IEEE802154_FRAMECTRL_FTYPE) >>
|
|
|
|
IEEE802154_FRAMECTRL_SHIFT_FTYPE;
|
|
|
|
|
|
|
|
if (ftype == IEEE802154_FRAME_ACK)
|
|
|
|
{
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = 2;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Not sure why, but the ZEP header allows for a 4-byte sequence
|
|
|
|
* no. despite 802.15.4 sequence number only being 1-byte
|
2017-11-01 21:38:22 +01:00
|
|
|
*/
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i] = frame.meta.dsn;
|
|
|
|
i += 4;
|
2017-11-01 21:38:22 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = 1;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Next bytes is the Channel ID */
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
ieee802154_getchan(fd, &zepframe[i++]);
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* For now, just hard code the device ID to an arbitrary value */
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
zepframe[i++] = 0xfa;
|
|
|
|
zepframe[i++] = 0xde;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Not completely sure what LQI mode is. My best guess as of now
|
|
|
|
* based on a few comments in the Wireshark code is that it
|
|
|
|
* determines whether the last 2 bytes of the frame portion of the
|
|
|
|
* packet is the CRC or the LQI.
|
|
|
|
* I believe it is CRC = 1, LQI = 0. We will assume the CRC is the
|
|
|
|
* last few bytes as that is what the MAC layer expects.
|
|
|
|
* However, this may be a bad assumption for certain radios.
|
2017-11-01 21:38:22 +01:00
|
|
|
*/
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = 1;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Next byte is the LQI value */
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = frame.meta.lqi;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Need to use NTP to get time, but for now,
|
|
|
|
* include the system time
|
|
|
|
*/
|
2017-11-01 21:38:22 +01:00
|
|
|
|
2018-03-14 14:59:35 +01:00
|
|
|
systime = clock();
|
2019-08-10 20:26:33 +02:00
|
|
|
memcpy(&zepframe[i], &systime, 8);
|
|
|
|
i += 8;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Not sure why, but the ZEP header allows for a 4-byte sequence
|
|
|
|
* no. despite 802.15.4 sequence number only being 1-byte
|
2017-11-01 21:38:22 +01:00
|
|
|
*/
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i] = frame.meta.dsn;
|
2022-03-07 16:11:14 +01:00
|
|
|
zepframe[i + 1] = 0;
|
|
|
|
zepframe[i + 2] = 0;
|
|
|
|
zepframe[i + 3] = 0;
|
2019-08-10 20:26:33 +02:00
|
|
|
i += 4;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Skip 10-bytes for reserved fields */
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
i += 10;
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Last byte is the length */
|
|
|
|
|
2017-12-08 16:25:44 +01:00
|
|
|
#ifdef CONFIG_IEEE802154_I8SHARK_XBEE_APPHDR
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = frame.length - 2;
|
2017-12-08 16:25:44 +01:00
|
|
|
#else
|
2019-08-10 20:26:33 +02:00
|
|
|
zepframe[i++] = frame.length;
|
2017-12-08 16:25:44 +01:00
|
|
|
#endif
|
2017-11-01 21:38:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The ZEP header is filled, now copy the frame in */
|
|
|
|
|
2017-11-22 22:37:11 +01:00
|
|
|
#ifdef CONFIG_IEEE802154_I8SHARK_XBEE_APPHDR
|
2019-08-10 20:26:33 +02:00
|
|
|
memcpy(&zepframe[i], frame.payload, frame.offset);
|
|
|
|
i += frame.offset;
|
2017-11-22 22:37:11 +01:00
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
/* XBee radios use a 2 byte "application header" to support duplicate
|
|
|
|
* packet detection. Wireshark doesn't know how to handle this data,
|
|
|
|
* so we provide a configuration option that drops the first 2 bytes
|
|
|
|
* of the payload portion of the frame for all sniffed frames
|
2017-12-08 16:25:44 +01:00
|
|
|
*
|
2022-03-07 16:11:14 +01:00
|
|
|
* NOTE:
|
|
|
|
* Since we remove data from the frame, the FCS is no longer valid
|
|
|
|
* and Wireshark will fail to disect the frame. Wireshark ignores a
|
|
|
|
* case where the FCS is not included in the actual frame. Therefore,
|
|
|
|
* we subtract 4 rather than 2 to remove the FCS field so that the
|
|
|
|
* disector will not fail.
|
2017-11-22 22:37:11 +01:00
|
|
|
*/
|
|
|
|
|
2019-08-10 20:26:33 +02:00
|
|
|
memcpy(&zepframe[i], (frame.payload + frame.offset + 2),
|
2017-11-22 22:37:11 +01:00
|
|
|
(frame.length - frame.offset - 2));
|
2019-08-10 20:26:33 +02:00
|
|
|
i += frame.length - frame.offset - 4;
|
2017-11-22 22:37:11 +01:00
|
|
|
#else
|
2019-08-10 20:26:33 +02:00
|
|
|
/* If FCS suppression is enabled, subtract the FCS length to reduce the
|
|
|
|
* piece of the frame copied.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef CONFIG_IEEE802154_I8SHARK_SUPPRESS_FCS
|
2022-03-07 16:11:14 +01:00
|
|
|
{
|
2019-08-10 20:26:33 +02:00
|
|
|
uint8_t fcslen;
|
|
|
|
ieee802154_getfcslen(fd, &fcslen);
|
|
|
|
frame.length -= fcslen;
|
2022-03-07 16:11:14 +01:00
|
|
|
}
|
2019-08-10 20:26:33 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
memcpy(&zepframe[i], frame.payload, frame.length);
|
|
|
|
i += frame.length;
|
2017-11-22 22:37:11 +01:00
|
|
|
#endif
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
/* Send the encapsulated frame to Wireshark over UDP */
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
nbytes = sendto(sockfd, zepframe, i, 0,
|
|
|
|
(struct sockaddr *)&raddr, addrlen);
|
2019-08-10 20:26:33 +02:00
|
|
|
if (nbytes < i)
|
2017-11-01 21:38:22 +01:00
|
|
|
{
|
2022-03-07 16:11:14 +01:00
|
|
|
fprintf(stderr,
|
|
|
|
"ERROR: sendto() did not send all bytes. %d\n", errno);
|
2017-11-01 21:38:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_i8shark.daemon_started = false;
|
|
|
|
close(fd);
|
|
|
|
printf("i8shark: daemon closing\n");
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: i8shark_main
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int main(int argc, FAR char *argv[])
|
|
|
|
{
|
|
|
|
int argind = 1;
|
|
|
|
|
|
|
|
if (!g_i8shark.initialized)
|
|
|
|
{
|
|
|
|
i8shark_init(&g_i8shark);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (argc > 1)
|
|
|
|
{
|
2022-03-07 16:11:14 +01:00
|
|
|
/* If the first argument is an interface,
|
|
|
|
* update our character device path
|
|
|
|
*/
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
if (strncmp(argv[argind], "/dev/", 5) == 0)
|
|
|
|
{
|
|
|
|
/* Check if the name is the same as the current one */
|
|
|
|
|
|
|
|
if (!strcmp(g_i8shark.devpath, argv[argind]))
|
|
|
|
{
|
2022-03-07 16:11:14 +01:00
|
|
|
/* Adapter daemon can't be running when we change
|
|
|
|
* device path
|
|
|
|
*/
|
2017-11-01 21:38:22 +01:00
|
|
|
|
|
|
|
if (g_i8shark.daemon_started)
|
|
|
|
{
|
|
|
|
printf("Can't change devpath when daemon is running.\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Copy the path into our state structure */
|
|
|
|
|
2023-02-09 12:01:32 +01:00
|
|
|
strlcpy(g_i8shark.devpath, argv[1], sizeof(g_i8shark.devpath));
|
2017-11-01 21:38:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
argind++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the daemon is not running, start it. */
|
|
|
|
|
|
|
|
g_i8shark.daemon_pid = task_create("i8shark",
|
2022-03-07 16:11:14 +01:00
|
|
|
CONFIG_IEEE802154_I8SHARK_DAEMON_PRIORITY,
|
|
|
|
CONFIG_IEEE802154_I8SHARK_DAEMON_STACKSIZE,
|
|
|
|
i8shark_daemon, NULL);
|
2017-11-01 21:38:22 +01:00
|
|
|
if (g_i8shark.daemon_pid < 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "failed to start daemon\n");
|
|
|
|
return ERROR;
|
|
|
|
}
|
|
|
|
|
2022-03-07 16:11:14 +01:00
|
|
|
return OK;
|
2017-11-01 21:38:22 +01:00
|
|
|
}
|