Code Search for Developers
 
 
  

afa_fragmentation.h from EmStar at Krugle


Show afa_fragmentation.h syntax highlighted

/*
 * AFA fragmentation and reassembly library header file
 *
 * Jeremy Elson, USC/ISI
 *
 * For details on the theory of AFA fragmentation please see
 * http://www.circlemud.org/~jelson/writings/afa
 *
 * $Id: afa_fragmentation.h,v 1.4 2004/03/03 04:52:11 girod Exp $
 *
 * Copyright (c) 2000 by the University of Southern California 
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation in source and binary forms for non-commercial
 * purposes and without fee is hereby granted, provided that the above
 * copyright notice appear in all copies and that both the copyright
 * notice and this permission notice appear in supporting
 * documentation. and that any documentation, advertising materials,
 * and other materials related to such distribution and use
 * acknowledge that the software was developed by the University of
 * Southern California, Information Sciences Institute.  The name of
 * the University may not be used to endorse or promote products
 * derived from this software without specific prior written
 * permission.
 *
 * THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations
 * about the suitability of this software for any purpose.  THIS
 * SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * Other copyrights might apply to parts of this software and are so
 * noted when applicable.
 */

/*************************** Public Interface *****************************/

#include <sys/time.h>
#include <link/link_headers.h>

#define MALLOC(type, len) (type *) malloc(len)
#define FREE(x) free(x)


/* downcalls provided by the fragmentation library */
void fragmentation_init(void);
void fragmentation_shutdown(void);
int fragmentation_set_mtu(int mtu);
void process_incoming_fragment(caddr_t message, int length,
                               struct timeval packet_time, void *data);
int fragment_message(const caddr_t message, int length, u_int8_t type, void *data);

/* upcalls needed by the fragmentation library */
int send_fragment_upcall(caddr_t message, int length, void *data);
void deliver_packet_upcall(caddr_t message, int length,
                           struct timeval packet_time, u_int8_t type,
			   void *data);



/**************** Private Definitions (not part of API) *********************/

#if defined(__AFA_FRAGMENTATION_C__)


#define FRAG_MAX_DATA_LEN     230       /* max data payload in bytes */
#define FRAG_DEFAULT_DATA_LEN 23
#define MAX_PACKETS           128       /* 7 bits of frag ID */
#define MAX_PACKET_SIZE       8196

/* header that RPC daemon sends before a fragment: for a "fragment
 * data" type packet.  */
typedef struct {
  frag_common_header_t hdr;
  
  char data[FRAG_MAX_DATA_LEN];
} frag_data_t;

typedef struct {
  u_int32_t checksum;
  u_int16_t length;
  u_int8_t type;
  caddr_t data;
  struct timeval time;
} rpc_packet_t;


#endif




See more files for this project here

EmStar

EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.

Project homepage: http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other

  frag2/
    frag.c
    frag.h
    frag2test.run
    frag2test.sim
    fragping.c
    fragping.h
    fragping.run
  afa_fragmentation.c
  afa_fragmentation.h
  fragd_i.h
  fragd_main.c
  fragd_passthru.c
  fragtest.run
  fragtest.sim