eth_proto.c
author viric@llimona
Thu, 27 Sep 2007 00:25:54 +0200
changeset 58 2cf8c513d18f
parent 53 07500c5c53cb
child 60 18c24be2b1a6
permissions -rw-r--r--
added authors.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     1
/*
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     2
    Terminal Mixer - multi-point multi-user access to terminal applications
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     3
    Copyright (C) 2007  LluĂ­s Batlle i Rossell
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     4
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     5
    Please find the license in the provided COPYING file.
07500c5c53cb Adding license and web html.
viric@llimona
parents: 48
diff changeset
     6
*/
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
     7
#include <netinet/in.h>
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
     8
#include <string.h>
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
     9
#include <stdio.h>
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    10
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    11
#include "eth_linux.h"
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    12
#include "main.h"
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    13
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    14
static struct
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    15
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    16
    int socket;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    17
    char partner[6];
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    18
    int partner_set;
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    19
    unsigned int seq_send;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    20
    unsigned int seq_wait;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    21
    unsigned int wrong_recv;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    22
} edata;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    23
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    24
enum Control{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    25
    SEND,
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    26
    ACK,
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    27
    NAK
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    28
};
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    29
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    30
enum {
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    31
    MAXPACKET = 1000,
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    32
    HEAD = 9
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    33
};
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    34
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    35
static char eth_buffer[1000];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    36
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    37
static void eth_fill_mac(unsigned char *mac, const char *str);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    38
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    39
static int make_head(unsigned char *data, unsigned int seq, enum Control c,
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    40
        int size)
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    41
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    42
    *((unsigned int *) data) = htonl(seq);
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    43
    data[4] = (unsigned char) c;
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    44
    *((unsigned int *)(data+5)) = htonl(size);
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    45
    return HEAD;
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    46
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    47
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    48
static int parse_head(unsigned char *data, unsigned int *seq, enum Control *c,
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    49
        int *size)
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    50
{
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    51
    *seq = ntohl( *((unsigned int*) data) );
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    52
    *c = data[4];
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    53
    if (size)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    54
        *size = ntohl(*((unsigned int *)(data+5)));
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    55
    return HEAD;
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    56
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    57
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    58
void eth_proto_init()
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    59
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    60
    edata.socket = -1;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    61
    edata.seq_send = 0;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    62
    edata.seq_wait = 0;
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    63
    edata.partner_set = 0;
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    64
    if (command_line.c_param.server_address);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    65
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    66
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    67
int eth_proto_open()
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    68
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    69
    edata.socket = eth_open(command_line.eth_device);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    70
    if (edata.socket == -1)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    71
        error("Cannot open device %s", command_line.eth_device);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    72
    return edata.socket;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    73
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    74
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    75
int eth_proto_recv(char *data, int size)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    76
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    77
    int res;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    78
    int seq;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    79
    enum Control c;
46
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    80
    char partner[6];
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    81
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    82
    do {
46
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    83
            res = eth_recv(eth_buffer, sizeof(eth_buffer), partner);
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    84
            edata.partner_set = 1;
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    85
    } while(res < HEAD);
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
    86
    parse_head(eth_buffer, &seq, &c, &res);
46
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    87
    /* We admit any first connection */
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    88
    if (seq == 0)
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    89
    {
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    90
      edata.seq_wait = 0;
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    91
      memcpy(edata.partner, partner, sizeof(edata.partner));
bb76f8ca177d Allowing eth reconnections. Added DOCS.
lbatlle@npdl268.bpo.hp.com
parents: 44
diff changeset
    92
    }
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
    93
    /*
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    94
    if (seq != edata.seq_wait)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    95
    {
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    96
        edata.wrong_recv++;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    97
        return -1;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
    98
    }
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
    99
    */
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   100
    /* res comes from parse_head. */
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   101
    memcpy(data, eth_buffer + HEAD, min(size, res));
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   102
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
   103
    /*
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   104
    make_head(eth_buffer, seq, ACK, 0);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   105
    eth_send(command_line.eth_device, edata.partner, eth_buffer, HEAD);
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
   106
    */
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   107
    edata.seq_wait++;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   108
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   109
    return res;
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   110
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   111
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   112
int eth_proto_send(const char *data, int size)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   113
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   114
    int total = size;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   115
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   116
    if (!edata.partner_set)
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   117
    {
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   118
        if (edata.seq_send == 0 && !command_line.is_server
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   119
                && command_line.c_param.server_address != 0)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   120
        {
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   121
            eth_fill_mac(edata.partner, command_line.c_param.server_address);
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   122
            edata.partner_set = 1;
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   123
        }
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   124
        else
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   125
            return 0;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   126
    }
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   127
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   128
    do {
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   129
        int once;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   130
        int sent;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   131
        int rseq;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   132
        enum Control rc;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   133
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   134
        once = min(sizeof(eth_buffer)-HEAD, size);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   135
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   136
        make_head(eth_buffer, edata.seq_send, SEND, once);
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   137
        memcpy(eth_buffer+HEAD, data, once);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   138
        sent = eth_send(command_line.eth_device, edata.partner,
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   139
                eth_buffer, once+HEAD);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   140
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
   141
        /*
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   142
        eth_recv(eth_buffer, HEAD, 0);
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 43
diff changeset
   143
        parse_head(eth_buffer, &rseq, &rc, 0);
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   144
        if (rc != ACK || rseq != edata.seq_send)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   145
            continue;
48
ffea64c65751 Making eth-protocol not reliable.
viric@llimona
parents: 46
diff changeset
   146
        */
43
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   147
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   148
        edata.seq_send++;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   149
        size -= sent;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   150
        data += sent;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   151
    } while(size > 0);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   152
    return total;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   153
}
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   154
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   155
static void eth_fill_mac(unsigned char *mac, const char *str)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   156
{
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   157
  int res;
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   158
  int imac[6];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   159
  res = sscanf(str, "%x:%x:%x:%x:%x:%x",
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   160
      &imac[0],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   161
      &imac[1],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   162
      &imac[2],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   163
      &imac[3],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   164
      &imac[4],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   165
      &imac[5]);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   166
  if (res != 6)
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   167
  {
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   168
    error("Error parsing mac: %02x:%02x:%02x:%02x:%02x:%02x\n",
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   169
      imac[0],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   170
      imac[1],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   171
      imac[2],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   172
      imac[3],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   173
      imac[4],
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   174
      imac[5]);
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   175
  }
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   176
  mac[0] = imac[0];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   177
  mac[1] = imac[1];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   178
  mac[2] = imac[2];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   179
  mac[3] = imac[3];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   180
  mac[4] = imac[4];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   181
  mac[5] = imac[5];
625794738afc Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
diff changeset
   182
}