understading tcpdump.c file in contiki : I am trying to go through this file in contiki and finding it difficult to comprehend what is the purpose and why it is using such obfuscated code


    /*---------------------------------------------------------------------------*/
    static char *
    s(char *str, char *ptr)
    {
      strcpy(ptr, str);
      return ptr + strlen(str);
    }
    /*---------------------------------------------------------------------------*/
    int
    tcpdump_format(uint8_t *packet, uint16_t packetlen,
    	       char *buf, uint16_t buflen)
    {
      char flags[8];
      if(IPBUF->proto == UIP_PROTO_ICMP) {
        if(ICMPBUF->type == ICMP_ECHO) {
          return s(" ping",
    	     n(IPBUF->destipaddr[3], d(
    	     n(IPBUF->destipaddr[2], d(
    	     n(IPBUF->destipaddr[1], d(
    	     n(IPBUF->destipaddr[0],
                 s(" ",
    	     n(IPBUF->srcipaddr[3], d(
    	     n(IPBUF->srcipaddr[2], d(
    	     n(IPBUF->srcipaddr[1], d(
                 n(IPBUF->srcipaddr[0],
    	     buf)))))))))))))))) - buf;
    	     
          /*      return sprintf(buf, "%d.%d.%d.%d %d.%d.%d.%d ping",
    		     IPBUF->srcipaddr[0], IPBUF->srcipaddr[1],
    		     IPBUF->srcipaddr[2], IPBUF->srcipaddr[3],
    		     IPBUF->destipaddr[0], IPBUF->destipaddr[1],
    		     IPBUF->destipaddr[2], IPBUF->destipaddr[3]);*/
        }

[https://github.com/contiki-os/contiki/blob/master/tools/wpcapslip/tcpdump.c][1]

the commented part tells what the code is trying to do but why in this way..?
  [1]: http://complete%20file