mirror of
https://github.com/n5ac/smartsdr-dsp.git
synced 2026-04-04 22:07:33 +00:00
Initial load of CODEC2/FreeDV software and wrapper
This commit is contained in:
parent
f524f31e45
commit
cea38b61ea
204 changed files with 41852 additions and 0 deletions
58
DSP_API/SmartSDR_Interface/io_utils.c
Normal file
58
DSP_API/SmartSDR_Interface/io_utils.c
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
///*! \file io_utils.c
|
||||
// * \brief Module that contains various IO utilities
|
||||
// *
|
||||
// * \copyright Copyright 2011-2012 FlexRadio Systems. All Rights Reserved.
|
||||
// * Unauthorized use, duplication or distribution of this software is
|
||||
// * strictly prohibited by law.
|
||||
// *
|
||||
// * \date 9-NOV-2011
|
||||
// * \author Terry Gerdes, AB5K
|
||||
// * \author Stephen Hicks, N5AC
|
||||
// */
|
||||
|
||||
/* *****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2014 FlexRadio Systems.
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact Information:
|
||||
* email: gpl<at>flexradiosystems.com
|
||||
* Mail: FlexRadio Systems, Suite 1-150, 4616 W. Howard LN, Austin, TX 78728
|
||||
*
|
||||
* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uint32 net_get_ip()
|
||||
{
|
||||
struct ifaddrs* ifAddrStruct = NULL;
|
||||
struct ifaddrs* ifa = NULL;
|
||||
uint32 ip = 0;
|
||||
|
||||
getifaddrs(&ifAddrStruct);
|
||||
|
||||
ifa = ifAddrStruct->ifa_next->ifa_next->ifa_next->ifa_next; // skip to 4th interface
|
||||
ip = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;
|
||||
|
||||
freeifaddrs(ifAddrStruct);
|
||||
|
||||
return ip;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue