00001 /* 00002 * Copyright (c) 2001 University of Southern California. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms are permitted 00006 * provided that the above copyright notice and this paragraph are 00007 * duplicated in all such forms and that any documentation, advertising 00008 * materials, and other materials related to such distribution and use 00009 * acknowledge that the software was developed by the University of 00010 * Southern California, Information Sciences Institute. The name of the 00011 * University may not be used to endorse or promote products derived from 00012 * this software without specific prior written permission. 00013 * 00014 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 00015 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 00016 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 * 00018 ** 00019 * Quick Start for TCP and IP. 00020 * A scheme for transport protocols to dynamically determine initial 00021 * congestion window size. 00022 * 00023 * http://www.ietf.org/internet-drafts/draft-amit-quick-start-02.ps 00024 * 00025 * This defines the Quick Start packet header 00026 * 00027 * hdr_qs.h 00028 * 00029 * Srikanth Sundarrajan, 2002 00030 * sundarra@usc.edu 00031 */ 00032 00033 #ifndef _HDR_QS_H 00034 #define _HDR_QS_H 00035 00036 #include <assert.h> 00037 #include <packet.h> 00038 00039 enum QS_STATE { QS_DISABLE, QS_REQUEST, QS_RESPONSE }; 00040 00041 struct hdr_qs { 00042 00043 int flag_; // 1 for request, 0 for response all others invalid 00044 int ttl_; 00045 int rate_; 00046 00047 static int offset_; // offset for this header 00048 inline int& offset() { return offset_; } 00049 00050 inline static hdr_qs* access(Packet* p) { 00051 return (hdr_qs*) p->access(offset_); 00052 } 00053 00054 int& flag() { return flag_; } 00055 int& ttl() { return ttl_; } 00056 int& rate() { return rate_; } 00057 00058 }; 00059 00060 #endif
1.3.3