typedef u8 byte_t;
/* Boolean type */
+#ifndef SYS_SOLARIS
typedef int boolean_t;
+#else
+#include <sys/types.h>
+#endif
#ifdef SYS_GNU
#define _MACH_I386_BOOLEAN_H_
#endif
/*****************************************************************************
* Required headers:
* <netinet/in.h>
+ * <sys/socket.h>
*****************************************************************************/
if( i_best_score == 0 )
{
free( p_intf );
+ intf_ErrMsg( "error: no suitable plugin to create interface\n" );
return( NULL );
}
/*
* Convert message to string
*/
-#ifdef SYS_BEOS
+#if defined SYS_BEOS || defined SYS_SOLARIS
psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
/*
* Convert message to string
*/
-#ifdef SYS_BEOS
+#if defined SYS_BEOS || defined SYS_SOLARIS
psz_str = (char*) malloc( INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
#include "defs.h"
#include <signal.h> /* SIGHUP, SIGINT, SIGKILL */
-#include <getopt.h> /* getopt() */
#include <stdio.h> /* sprintf() */
+#ifdef HAVE_LIBGNUGETOPT
+#include <getopt.h> /* getopt() */
+#endif
+
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* getenv(), strtol(), */
#include <string.h> /* strerror() */
#define LONG_HELP 2
/* Long options */
+#ifdef HAVE_LIBGNUGETOPT
static const struct option longopts[] =
{
/* name, has_arg, flag, val */
/* Short options */
static const char *psz_shortopts = "hHvga:s:c:";
+#endif
+
/*****************************************************************************
* Global variable program_data - this is the one and only, see main.h
}
/* Parse command line options */
+#ifdef HAVE_LIBGNUGETOPT
opterr = 0;
while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
{
break;
}
}
+#endif
/* Parse command line parameters - no check is made for these options */
for( i_opt = optind; i_opt < i_argc; i_opt++ )
#include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
#endif
-#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
+#if defined (HAVE_SYS_IOCTL_H)
#include <sys/ioctl.h> /* ioctl() */
+#endif
+
+#include <unistd.h> /* needed for ioctl on Solaris */
+#include <stropts.h>
+
+#if defined (HAVE_NET_IF_H)
#include <net/if.h> /* interface (arch-dependent) */
#endif
+//#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+//#endif
#include "config.h"
#include "common.h"
}
/* Try to convert address directly from in_addr - this will work if
* psz_in_addr is dotted decimal. */
-#ifdef HAVE_ARPA_INET_H
+#if defined HAVE_ARPA_INET_H && !defined SYS_SOLARIS
else if( !inet_aton( psz_in_addr, &p_sa_in->sin_addr) )
#else
else if( (p_sa_in->sin_addr.s_addr = inet_addr( psz_in_addr )) == -1 )
}
/* Read physical address of the interface and store it in our description */
+#ifdef SYS_SOLARIS
+ i_rc = ioctl(i_sockfd, SIOCGENADDR, (byte_t *)&ifr_config);
+#else
i_rc = ioctl(i_sockfd, SIOCGIFHWADDR, (byte_t *)&ifr_config);
+#endif
if( !i_rc )
{
memcpy(&p_ifdescr->sa_phys_addr, &ifr_config.ifr_addr, sizeof(struct sockaddr));
*****************************************************************************/
int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
{
+ int i_rc = 0;
+
#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
struct ifreq* a_ifr_ifconf = NULL;
struct ifreq* p_ifr_current_if;
int i_if_number;
int i_remaining;
-#endif
- int i_rc = 0;
-#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
ASSERT(p_net_descr);
/* Start by assuming we have few than 3 interfaces (i_if_number will
p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
if( p_vout == NULL )
{
- intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
+ intf_ErrMsg( "vout error: %s\n", strerror(ENOMEM) );
return( NULL );
}
if( vlc_thread_create( &p_vout->thread_id, "video output",
(void *) RunThread, (void *) p_vout) )
{
- intf_ErrMsg("error: %s\n", strerror(ENOMEM));
+ intf_ErrMsg("vout error: %s\n", strerror(ENOMEM));
vout_UnloadFont( p_vout->p_default_font );
vout_UnloadFont( p_vout->p_large_font );
p_vout->p_sys_destroy( p_vout );