Subversion Repositories Spectranet

[/] [trunk/] [utils/] [configserv.c] - Diff between revs 426 and 495

Show entire file | Details | Blame | View Log

Rev 426 Rev 495
Line 29... Line 29...
 *
 *
 * During initial configuration the Spectrum has a hard-coded MAC
 * During initial configuration the Spectrum has a hard-coded MAC
 * address and IP for the purposes of querying this server. */
 * address and IP for the purposes of querying this server. */
 
 
#include <stdio.h>
#include <stdio.h>
#include <sys/socket.h>
 
#include <sys/types.h>
#include <sys/types.h>
#include <netinet/in.h>
 
#include <unistd.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
 
 
 
#ifdef WIN32
 
#include <winsock.h>
 
#else
 
#include <sys/socket.h>
 
#include <netinet/in.h>
 
#endif
 
 
#define DATASZ  24
#define DATASZ  24
 
 
void server(char *file, int port);
void server(char *file, int port);
void getdata(char *file, char *data);
void getdata(char *file, char *data);
 
 
Line 105... Line 110...
        } else {
        } else {
                perror("reading serial number");
                perror("reading serial number");
                exit(-1);
                exit(-1);
        }
        }
 
 
        mac=random();
        mac=rand();
 
 
        data[0]=0x00;
        data[0]=0x00;
        data[1]=0xAA;
        data[1]=0xAA;
        data[2]=mac & 0xFF;
        data[2]=mac & 0xFF;
        data[3]=(mac >> 8) & 0xFF;
        data[3]=(mac >> 8) & 0xFF;