Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 637a3b4 in mainline


Ignore:
Timestamp:
2012-03-09T19:41:43Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
ffa8912
Parents:
fa101c4
Message:

ICMP echo replying.

Location:
uspace/srv/inet
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/inet/Makefile

    rfa101c4 r637a3b4  
    3232SOURCES = \
    3333        addrobj.c \
     34        icmp.c \
    3435        inet.c \
    3536        inet_link.c \
  • uspace/srv/inet/inet.c

    rfa101c4 r637a3b4  
    4848
    4949#include "addrobj.h"
     50#include "icmp.h"
     51#include "icmp_std.h"
    5052#include "inet.h"
    5153#include "inetcfg.h"
     
    110112}
    111113
    112 static int inet_route_packet(inet_dgram_t *dgram, uint8_t proto, uint8_t ttl,
     114int inet_route_packet(inet_dgram_t *dgram, uint8_t proto, uint8_t ttl,
    113115    int df)
    114116{
     
    338340        log_msg(LVL_DEBUG, "inet_recv_dgram_local()");
    339341
     342        /* ICMP messages are handled internally */
     343        if (proto == IP_PROTO_ICMP)
     344                return icmp_recv(dgram);
     345
    340346        client = inet_client_find(proto);
    341347        if (client == NULL) {
  • uspace/srv/inet/inet.h

    rfa101c4 r637a3b4  
    117117extern int inet_ev_recv(inet_client_t *, inet_dgram_t *);
    118118extern int inet_recv_packet(inet_packet_t *);
     119extern int inet_route_packet(inet_dgram_t *, uint8_t, uint8_t, int);
    119120
    120121#endif
  • uspace/srv/inet/pdu.c

    rfa101c4 r637a3b4  
    5151static uint16_t ip_ident = 0;
    5252
    53 #define INET_CHECKSUM_INIT 0xffff
    54 
    5553/** One's complement addition.
    5654 *
     
    6563}
    6664
    67 static uint16_t inet_checksum_calc(uint16_t ivalue, void *data, size_t size)
     65uint16_t inet_checksum_calc(uint16_t ivalue, void *data, size_t size)
    6866{
    6967        uint16_t sum;
  • uspace/srv/inet/pdu.h

    rfa101c4 r637a3b4  
    3838#define INET_PDU_H_
    3939
     40#include <sys/types.h>
    4041#include "inet.h"
     42
     43#define INET_CHECKSUM_INIT 0xffff
     44
     45extern uint16_t inet_checksum_calc(uint16_t, void *, size_t);
    4146
    4247extern int inet_pdu_encode(inet_packet_t *, void **, size_t *);
Note: See TracChangeset for help on using the changeset viewer.