Changeset 87e5658c in mainline for uspace/srv/ethip/ethip.c


Ignore:
Timestamp:
2012-02-27T00:03:26Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
962f03b
Parents:
081971b
Message:

Prototype ARP responder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ethip/ethip.c

    r081971b r87e5658c  
    4545#include <stdlib.h>
    4646
     47#include "arp.h"
    4748#include "ethip.h"
    4849#include "ethip_nic.h"
     
    204205        }
    205206
    206         log_msg(LVL_DEBUG, " - construct SDU");
    207         sdu.lsrc.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 1;
    208         sdu.ldest.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 4;
    209         sdu.data = frame.data;
    210         sdu.size = frame.size;
    211         log_msg(LVL_DEBUG, " - call iplink_ev_recv");
    212         rc = iplink_ev_recv(&nic->iplink, &sdu);
     207        switch (frame.etype_len) {
     208        case ETYPE_ARP:
     209                arp_received(nic, &frame);
     210                break;
     211        case ETYPE_IP:
     212                log_msg(LVL_DEBUG, " - construct SDU");
     213                sdu.lsrc.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 1;
     214                sdu.ldest.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 4;
     215                sdu.data = frame.data;
     216                sdu.size = frame.size;
     217                log_msg(LVL_DEBUG, " - call iplink_ev_recv");
     218                rc = iplink_ev_recv(&nic->iplink, &sdu);
     219                break;
     220        default:
     221                log_msg(LVL_DEBUG, "Unknown ethertype %" PRIu16,
     222                    frame.etype_len);
     223        }
    213224
    214225        free(frame.data);
Note: See TracChangeset for help on using the changeset viewer.