netutils.c 14.3 KB
Newer Older
1
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
2
 * netutils.c: various network functions
3
 *****************************************************************************
4
 * Copyright (C) 1999-2001 VideoLAN
5
 * $Id: netutils.c,v 1.68 2002/06/01 18:04:49 sam Exp $
6
 *
7
 * Authors: Vincent Seguin <seguin@via.ecp.fr>
Benoit Steiner's avatar
   
Benoit Steiner committed
8
 *          Benoit Steiner <benny@via.ecp.fr>
Henri Fallon's avatar
   
Henri Fallon committed
9
 *          Henri Fallon <henri@videolan.org>
Xavier Marchesini's avatar
   
Xavier Marchesini committed
10
 *          Xavier Marchesini <xav@alarue.net>
11
12
 *          Christophe Massiot <massiot@via.ecp.fr>
 *          Samuel Hocevar <sam@via.ecp.fr>
13
14
15
16
17
 *
 * 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.
Sam Hocevar's avatar
   
Sam Hocevar committed
18
 *
19
20
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
23
 *
24
25
26
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
27
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
28

29
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
30
 * Preamble
31
 *****************************************************************************/
32
33
#include <stdlib.h>                             /* free(), realloc(), atoi() */
#include <errno.h>                                                /* errno() */
Sam Hocevar's avatar
   
Sam Hocevar committed
34
#include <string.h>                                              /* memset() */
Sam Hocevar's avatar
   
Sam Hocevar committed
35

36
#include <vlc/vlc.h>
Sam Hocevar's avatar
   
Sam Hocevar committed
37

Sam Hocevar's avatar
   
Sam Hocevar committed
38
#ifdef HAVE_UNISTD_H
Sam Hocevar's avatar
   
Sam Hocevar committed
39
#   include <unistd.h>                                      /* gethostname() */
Sam Hocevar's avatar
   
Sam Hocevar committed
40
#elif defined( _MSC_VER ) && defined( _WIN32 )
Sam Hocevar's avatar
   
Sam Hocevar committed
41
#   include <io.h>
Sam Hocevar's avatar
   
Sam Hocevar committed
42
43
44
#endif

#if !defined( _MSC_VER )
Henri Fallon's avatar
   
Henri Fallon committed
45
#include <sys/time.h>                                        /* gettimeofday */
Sam Hocevar's avatar
   
Sam Hocevar committed
46
#endif
47

Sam Hocevar's avatar
   
Sam Hocevar committed
48
49
#ifdef WIN32
#   include <winsock2.h>
Sam Hocevar's avatar
   
Sam Hocevar committed
50
#else
Sam Hocevar's avatar
   
Sam Hocevar committed
51
52
53
54
55
56
#   include <netdb.h>                                         /* hostent ... */
#   include <sys/socket.h>                           /* BSD: struct sockaddr */
#   include <netinet/in.h>                            /* BSD: struct in_addr */
#   ifdef HAVE_ARPA_INET_H
#       include <arpa/inet.h>                    /* inet_ntoa(), inet_aton() */
#   endif
57
58
#endif

Henri Fallon's avatar
   
Henri Fallon committed
59
60
61
62
#ifdef SYS_LINUX
#include <sys/ioctl.h>                                            /* ioctl() */
#endif

Sam Hocevar's avatar
   
Sam Hocevar committed
63
#if defined( WIN32 )                    /* tools to get the MAC adress from  */
Sam Hocevar's avatar
   
Sam Hocevar committed
64
#include <windows.h>                    /* the interface under Windows       */
Xavier Marchesini's avatar
Xavier Marchesini committed
65
#include <stdio.h>
gbazin's avatar
   
gbazin committed
66
#include <nb30.h>
Xavier Marchesini's avatar
Xavier Marchesini committed
67
68
#endif

Sam Hocevar's avatar
   
Sam Hocevar committed
69
#ifdef HAVE_NET_IF_H
70
71
#include <net/if.h>                            /* interface (arch-dependent) */
#endif
Henri Fallon's avatar
   
Henri Fallon committed
72

Benoit Steiner's avatar
   
Benoit Steiner committed
73
#ifdef HAVE_SYS_SOCKIO_H
Benoit Steiner's avatar
Benoit Steiner committed
74
#include <sys/sockio.h>
Benoit Steiner's avatar
   
Benoit Steiner committed
75
#endif
Michel Kaempf's avatar
Michel Kaempf committed
76

Sam Hocevar's avatar
   
Sam Hocevar committed
77
#include "netutils.h"
Michel Kaempf's avatar
Michel Kaempf committed
78

79
#include "network.h"
Michel Kaempf's avatar
Michel Kaempf committed
80

81
/*****************************************************************************
Henri Fallon's avatar
   
Henri Fallon committed
82
83
84
85
86
87
88
 * input_channel_t: channel library data
 *****************************************************************************
 * Store global channel library data.
 * The part of the code concerning the channel changing process is unstable
 * as it depends on the VideoLAN channel server, which isn't frozen for
 * the time being.
 *****************************************************************************/
89
struct input_channel_s
Henri Fallon's avatar
   
Henri Fallon committed
90
{
Sam Hocevar's avatar
   
Sam Hocevar committed
91
    int         i_channel;                         /* current channel number */
Henri Fallon's avatar
   
Henri Fallon committed
92
    mtime_t     last_change;                             /* last change date */
93
};
Henri Fallon's avatar
   
Henri Fallon committed
94

Xavier Marchesini's avatar
Xavier Marchesini committed
95
/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
96
97
 * Local prototypes
 *****************************************************************************/
98
static int GetMacAddress   ( vlc_object_t *, int i_fd, char *psz_mac );
Sam Hocevar's avatar
   
Sam Hocevar committed
99
100
#ifdef WIN32
static int GetAdapterInfo  ( int i_adapter, char *psz_string );
Xavier Marchesini's avatar
Xavier Marchesini committed
101
102
#endif

Henri Fallon's avatar
   
Henri Fallon committed
103
104
105
106
/*****************************************************************************
 * network_ChannelCreate: initialize global channel method data
 *****************************************************************************
 * Initialize channel input method global data. This function should be called
Sam Hocevar's avatar
   
Sam Hocevar committed
107
 * once before any input thread is created or any call to other
Henri Fallon's avatar
   
Henri Fallon committed
108
109
 * input_Channel*() function is attempted.
 *****************************************************************************/
110
int __network_ChannelCreate( vlc_object_t *p_this )
Henri Fallon's avatar
   
Henri Fallon committed
111
{
112
#if !defined( SYS_LINUX ) && !defined( WIN32 )
113
114
    msg_Err( p_this, "VLAN-based channels are not supported "
                     "on this architecture" );
115
#endif
Sam Hocevar's avatar
   
Sam Hocevar committed
116

Henri Fallon's avatar
   
Henri Fallon committed
117
    /* Allocate structure */
118
119
    p_this->p_vlc->p_channel = malloc( sizeof( input_channel_t ) );
    if( p_this->p_vlc->p_channel == NULL )
Henri Fallon's avatar
   
Henri Fallon committed
120
    {
121
        msg_Err( p_this, "out of memory" );
Henri Fallon's avatar
   
Henri Fallon committed
122
123
124
125
        return( -1 );
    }

    /* Initialize structure */
126
127
    p_this->p_vlc->p_channel->i_channel   = 0;
    p_this->p_vlc->p_channel->last_change = 0;
Henri Fallon's avatar
   
Henri Fallon committed
128

129
    msg_Dbg( p_this, "channels initialized" );
Henri Fallon's avatar
   
Henri Fallon committed
130
131
132
133
134
135
    return( 0 );
}

/*****************************************************************************
 * network_ChannelJoin: join a channel
 *****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
136
137
138
139
 * This function will try to join a channel. If the relevant interface is
 * already on the good channel, nothing will be done. Else, and if possible
 * (if the interface is not locked), the channel server will be contacted
 * and a change will be requested. The function will block until the change
Sam Hocevar's avatar
   
Sam Hocevar committed
140
 * is effective. Note that once a channel is no more used, its interface
Henri Fallon's avatar
   
Henri Fallon committed
141
142
143
 * should be unlocked using input_ChannelLeave().
 * Non 0 will be returned in case of error.
 *****************************************************************************/
144
int __network_ChannelJoin( vlc_object_t *p_this, int i_channel )
Henri Fallon's avatar
   
Henri Fallon committed
145
{
146
#define VLCS_VERSION 13
Sam Hocevar's avatar
   
Sam Hocevar committed
147
#define MESSAGE_LENGTH 256
Sam Hocevar's avatar
   
Sam Hocevar committed
148

149
150
151
    module_t *       p_network;
    char *           psz_network = NULL;
    network_socket_t socket_desc;
Sam Hocevar's avatar
   
Sam Hocevar committed
152
153
    char psz_mess[ MESSAGE_LENGTH ];
    char psz_mac[ 40 ];
154
    int i_fd, i_port;
Sam Hocevar's avatar
   
Sam Hocevar committed
155
156
157
    char *psz_vlcs;
    struct timeval delay;
    fd_set fds;
Sam Hocevar's avatar
   
Sam Hocevar committed
158

159
    if( !config_GetInt( p_this, "network-channel" ) )
Henri Fallon's avatar
   
Henri Fallon committed
160
    {
161
162
        msg_Err( p_this, "channels disabled, to enable them, use the"
                         " --channels option" );
Sam Hocevar's avatar
   
Sam Hocevar committed
163
        return -1;
Henri Fallon's avatar
   
Henri Fallon committed
164
    }
Sam Hocevar's avatar
   
Sam Hocevar committed
165

Henri Fallon's avatar
   
Henri Fallon committed
166
    /* If last change is too recent, wait a while */
167
168
//    if( mdate() - p_this->p_vlc->p_channel->last_change
//            < INPUT_CHANNEL_CHANGE_DELAY )
169
//    {
170
//        msg_Warn( p_this, "waiting before changing channel" );
Sam Hocevar's avatar
   
Sam Hocevar committed
171
        /* XXX Isn't this completely brain-damaged ??? -- Sam */
172
173
        /* Yes it is. I don't think this is still justified with the new
         * vlanserver --Meuuh */
174
175
//        mwait( p_this->p_vlc->p_channel->last_change
//                   + INPUT_CHANNEL_CHANGE_DELAY );
176
//    }
Sam Hocevar's avatar
   
Sam Hocevar committed
177

178
    if( config_GetInt( p_this, "ipv4" ) )
Sam Hocevar's avatar
   
Sam Hocevar committed
179
    {
180
        psz_network = "ipv4";
Sam Hocevar's avatar
   
Sam Hocevar committed
181
    }
182
    if( config_GetInt( p_this, "ipv6" ) )
Sam Hocevar's avatar
   
Sam Hocevar committed
183
    {
184
        psz_network = "ipv6";
Sam Hocevar's avatar
   
Sam Hocevar committed
185
186
    }

Sam Hocevar's avatar
   
Sam Hocevar committed
187
    /* Getting information about the channel server */
188
    if( !(psz_vlcs = config_GetPsz( p_this, "channel-server" )) )
gbazin's avatar
   
gbazin committed
189
    {
190
        msg_Err( p_this, "configuration variable channel-server empty" );
gbazin's avatar
   
gbazin committed
191
192
193
        return -1;
    }

194
    i_port = config_GetInt( p_this, "channel-port" );
Henri Fallon's avatar
   
Henri Fallon committed
195

196
    msg_Dbg( p_this, "connecting to %s:%d", psz_vlcs, i_port );
Marc Ariberti's avatar
Marc Ariberti committed
197

198
199
    /* Prepare the network_socket_t structure */
    socket_desc.i_type = NETWORK_UDP;
Sam Hocevar's avatar
   
Sam Hocevar committed
200
    socket_desc.psz_bind_addr = "";
201
202
203
204
205
    socket_desc.i_bind_port = 4321;
    socket_desc.psz_server_addr = psz_vlcs;
    socket_desc.i_server_port = i_port;

    /* Find an appropriate network module */
206
    p_network = module_Need( p_this, MODULE_CAPABILITY_NETWORK, psz_network,
207
208
                             &socket_desc );
    if( p_network == NULL )
Sam Hocevar's avatar
   
Sam Hocevar committed
209
    {
210
        return( -1 );
Sam Hocevar's avatar
   
Sam Hocevar committed
211
    }
212
213
214
215
    module_Unneed( p_network );

    free( psz_vlcs ); /* Do we really need this ? -- Meuuh */
    i_fd = socket_desc.i_handle;
Sam Hocevar's avatar
   
Sam Hocevar committed
216
217

    /* Look for the interface MAC address */
218
    if( GetMacAddress( p_this, i_fd, psz_mac ) )
Henri Fallon's avatar
   
Henri Fallon committed
219
    {
220
        msg_Err( p_this, "failed getting MAC address" );
Sam Hocevar's avatar
   
Sam Hocevar committed
221
        close( i_fd );
Sam Hocevar's avatar
   
Sam Hocevar committed
222
        return -1;
Marc Ariberti's avatar
Marc Ariberti committed
223
    }
Henri Fallon's avatar
   
Henri Fallon committed
224

225
    msg_Dbg( p_this, "MAC address is %s", psz_mac );
Henri Fallon's avatar
   
Henri Fallon committed
226

Sam Hocevar's avatar
   
Sam Hocevar committed
227
228
    /* Build the message */
    sprintf( psz_mess, "%d %u %lu %s \n", i_channel, VLCS_VERSION,
229
                       (unsigned long)(mdate() / (u64)1000000),
Sam Hocevar's avatar
   
Sam Hocevar committed
230
                       psz_mac );
Sam Hocevar's avatar
   
Sam Hocevar committed
231

Sam Hocevar's avatar
   
Sam Hocevar committed
232
    /* Send the message */
233
    send( i_fd, psz_mess, MESSAGE_LENGTH, 0 );
Henri Fallon's avatar
   
Henri Fallon committed
234

235
    msg_Dbg( p_this, "attempting to join channel %d", i_channel );
Henri Fallon's avatar
   
Henri Fallon committed
236

Sam Hocevar's avatar
   
Sam Hocevar committed
237
    /* We have changed channels ! (or at least, we tried) */
238
239
    p_this->p_vlc->p_channel->last_change = mdate();
    p_this->p_vlc->p_channel->i_channel = i_channel;
Sam Hocevar's avatar
   
Sam Hocevar committed
240

Sam Hocevar's avatar
   
Sam Hocevar committed
241
242
243
    /* Wait 5 sec for an answer from the server */
    delay.tv_sec = 5;
    delay.tv_usec = 0;
Sam Hocevar's avatar
   
Sam Hocevar committed
244
    FD_ZERO( &fds );
Sam Hocevar's avatar
   
Sam Hocevar committed
245
    FD_SET( i_fd, &fds );
Sam Hocevar's avatar
   
Sam Hocevar committed
246

Sam Hocevar's avatar
   
Sam Hocevar committed
247
    switch( select( i_fd + 1, &fds, NULL, NULL, &delay ) )
Henri Fallon's avatar
   
Henri Fallon committed
248
    {
Sam Hocevar's avatar
   
Sam Hocevar committed
249
        case 0:
250
            msg_Err( p_this, "no answer from vlcs" );
Sam Hocevar's avatar
   
Sam Hocevar committed
251
252
253
254
            close( i_fd );
            return -1;

        case -1:
255
            msg_Err( p_this, "error while listening to vlcs" );
Sam Hocevar's avatar
   
Sam Hocevar committed
256
257
258
            close( i_fd );
            return -1;
    }
Sam Hocevar's avatar
   
Sam Hocevar committed
259

260
261
    recv( i_fd, psz_mess, MESSAGE_LENGTH, 0 );
    psz_mess[ MESSAGE_LENGTH - 1 ] = '\0';
Sam Hocevar's avatar
   
Sam Hocevar committed
262

263
    if( !strncasecmp( psz_mess, "E:", 2 ) )
Sam Hocevar's avatar
   
Sam Hocevar committed
264
    {
265
        msg_Err( p_this, "vlcs said '%s'", psz_mess + 2 );
Sam Hocevar's avatar
   
Sam Hocevar committed
266
267
268
        close( i_fd );
        return -1;
    }
269
    else if( !strncasecmp( psz_mess, "I:", 2 ) )
Sam Hocevar's avatar
   
Sam Hocevar committed
270
    {
271
        msg_Dbg( p_this, "vlcs said '%s'", psz_mess + 2 );
Sam Hocevar's avatar
   
Sam Hocevar committed
272
273
274
    }
    else /* We got something to play ! FIXME: not very nice */
    {
275
276
277
278
#if 0
#   define p_item (&p_this->p_vlc->p_playlist->p_item \
                       [ p_this->p_vlc->p_playlist->i_index + 1])
        vlc_mutex_lock( &p_this->p_vlc->p_playlist->change_lock );
279
280
281
282
        if( p_item )
        {
            free( p_item->psz_name );
            p_item->psz_name = strdup( psz_mess );
Sam Hocevar's avatar
   
Sam Hocevar committed
283
            /* Unlock _afterwards_ */
284
            vlc_mutex_unlock( &p_this->p_vlc->p_playlist->change_lock );
285
286
287
        }
        else
        {
Sam Hocevar's avatar
   
Sam Hocevar committed
288
            /* Unlock _before_ */
289
290
            vlc_mutex_unlock( &p_this->p_vlc->p_playlist->change_lock );
            intf_PlaylistAdd( p_this->p_vlc->p_playlist, 0, psz_mess );
291
        }
292
#endif
Henri Fallon's avatar
   
Henri Fallon committed
293
    }
Sam Hocevar's avatar
   
Sam Hocevar committed
294

Sam Hocevar's avatar
   
Sam Hocevar committed
295
    /* Close the socket and return nicely */
296
#ifndef WIN32
Sam Hocevar's avatar
   
Sam Hocevar committed
297
    close( i_fd );
298
299
300
#else
    closesocket( i_fd );
#endif
Henri Fallon's avatar
   
Henri Fallon committed
301

Sam Hocevar's avatar
   
Sam Hocevar committed
302
    return 0;
Henri Fallon's avatar
   
Henri Fallon committed
303
}
Sam Hocevar's avatar
   
Sam Hocevar committed
304

Sam Hocevar's avatar
   
Sam Hocevar committed
305
306
307
308
309
/* Following functions are local */

/*****************************************************************************
 * GetMacAddress: extract the MAC Address
 *****************************************************************************/
310
static int GetMacAddress( vlc_object_t *p_this, int i_fd, char *psz_mac )
Sam Hocevar's avatar
   
Sam Hocevar committed
311
312
313
314
{
#if defined( SYS_LINUX )
    struct ifreq interface;
    int i_ret;
gbazin's avatar
   
gbazin committed
315
    char *psz_interface;
Sam Hocevar's avatar
   
Sam Hocevar committed
316
317
318
319
320

    /*
     * Looking for information about the eth0 interface
     */
    interface.ifr_addr.sa_family = AF_INET;
321
    if( !(psz_interface = config_GetPsz( p_this, "iface" )) )
gbazin's avatar
   
gbazin committed
322
    {
323
        msg_Err( p_this, "configuration variable iface empty" );
gbazin's avatar
   
gbazin committed
324
325
326
327
        return -1;
    }
    strcpy( interface.ifr_name, psz_interface );
    free( psz_interface );
Sam Hocevar's avatar
   
Sam Hocevar committed
328

Sam Hocevar's avatar
   
Sam Hocevar committed
329
    i_ret = ioctl( i_fd, SIOCGIFHWADDR, &interface );
Sam Hocevar's avatar
   
Sam Hocevar committed
330
331
332

    if( i_ret )
    {
333
        msg_Err( p_this, "ioctl SIOCGIFHWADDR failed" );
Sam Hocevar's avatar
   
Sam Hocevar committed
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
        return( i_ret );
    }

    sprintf( psz_mac, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
                      interface.ifr_hwaddr.sa_data[0] & 0xff,
                      interface.ifr_hwaddr.sa_data[1] & 0xff,
                      interface.ifr_hwaddr.sa_data[2] & 0xff,
                      interface.ifr_hwaddr.sa_data[3] & 0xff,
                      interface.ifr_hwaddr.sa_data[4] & 0xff,
                      interface.ifr_hwaddr.sa_data[5] & 0xff );

    return( 0 );

#elif defined( WIN32 )
    int i, i_ret = -1;

    /* Get adapter list - support for more than one adapter */
    LANA_ENUM AdapterList;
    NCB       Ncb;

354
    msg_Dbg( p_this, "looking for MAC address" );
Sam Hocevar's avatar
   
Sam Hocevar committed
355
356
357
358
359
360
361
362
363
364
365
366

    memset( &Ncb, 0, sizeof( NCB ) );
    Ncb.ncb_command = NCBENUM;
    Ncb.ncb_buffer = (unsigned char *)&AdapterList;
    Ncb.ncb_length = sizeof( AdapterList );
    Netbios( &Ncb );

    /* Get all of the local ethernet addresses */
    for ( i = 0; i < AdapterList.length ; ++i )
    {
        if ( GetAdapterInfo ( AdapterList.lana[ i ], psz_mac ) == 0 )
        {
Sam Hocevar's avatar
   
Sam Hocevar committed
367
            i_ret = 0;
Sam Hocevar's avatar
   
Sam Hocevar committed
368
369
370
371
372
        }
    }

    return( i_ret );

Sam Hocevar's avatar
   
Sam Hocevar committed
373
#else
374
375
    strcpy( psz_mac, "00:00:00:00:00:00" );
    return( 0 );
Sam Hocevar's avatar
   
Sam Hocevar committed
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399

#endif
}

#ifdef WIN32
/*****************************************************************************
 * GetAdapterInfo : gets some informations about the interface using NETBIOS
 *****************************************************************************/
static int GetAdapterInfo( int i_adapter, char *psz_string )
{
    struct ASTAT
    {
        ADAPTER_STATUS adapt;
        NAME_BUFFER    psz_name[30];
    } Adapter;

    /* Reset the LAN adapter so that we can begin querying it */
    NCB Ncb;
    memset( &Ncb, 0, sizeof ( Ncb ) );
    Ncb.ncb_command  = NCBRESET;
    Ncb.ncb_lana_num = i_adapter;

    if( Netbios( &Ncb ) != NRC_GOODRET )
    {
400
//X        intf_ErrMsg( "network error: reset returned %i", Ncb.ncb_retcode );
Sam Hocevar's avatar
   
Sam Hocevar committed
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
        return -1;
    }

    /* Prepare to get the adapter status block */
    memset( &Ncb, 0, sizeof( Ncb ) ) ;     /* Initialization */
    Ncb.ncb_command = NCBASTAT;
    Ncb.ncb_lana_num = i_adapter;

    strcpy( (char *)Ncb.ncb_callname, "*" );

    memset( &Adapter, 0, sizeof ( Adapter ) );
    Ncb.ncb_buffer = ( unsigned char * ) &Adapter;
    Ncb.ncb_length = sizeof ( Adapter );

    /* Get the adapter's info and, if this works, return it in standard,
     * colon-delimited form. */
    if ( Netbios( &Ncb ) == 0 )
    {
        sprintf ( psz_string, "%02X:%02X:%02X:%02X:%02X:%02X",
                (int) ( Adapter.adapt.adapter_address[0] ),
                (int) ( Adapter.adapt.adapter_address[1] ),
                (int) ( Adapter.adapt.adapter_address[2] ),
                (int) ( Adapter.adapt.adapter_address[3] ),
                (int) ( Adapter.adapt.adapter_address[4] ),
                (int) ( Adapter.adapt.adapter_address[5] ) );

427
//X        intf_WarnMsg( 2, "network: found MAC address %s", psz_string );
Sam Hocevar's avatar
   
Sam Hocevar committed
428
429
430
431
432

        return 0;
    }
    else
    {
433
//X        intf_ErrMsg( "network error: ASTAT returned %i", Ncb.ncb_retcode );
Sam Hocevar's avatar
   
Sam Hocevar committed
434
435
436
437
438
        return -1;
    }
}
#endif /* WIN32 */