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 * Light-Weight Multicast Services (LMS), Reliable Multicast 00020 * 00021 * classifier-lms.cc 00022 * 00023 * This is the classifier used to pick out LMS packets entering a node. 00024 * 00025 * Christos Papadopoulos. 00026 * christos@isi.edu 00027 */ 00028 00029 #include "config.h" 00030 #include "packet.h" 00031 #include "ip.h" 00032 #include "classifier.h" 00033 00034 class LmsClassifier : public Classifier { 00035 public: 00036 LmsClassifier(); 00037 protected: 00038 int classify(Packet *const p) 00039 { 00040 hdr_cmn* h = HDR_CMN(p); 00041 00042 if (h->ptype_ == PT_LMS) 00043 return 1; 00044 else return 0; 00045 } 00046 }; 00047 00048 static class LmsClassifierClass : public TclClass { 00049 public: 00050 LmsClassifierClass() : TclClass("Classifier/Lms") {} 00051 TclObject* create(int, const char*const*) { 00052 return (new LmsClassifier()); 00053 } 00054 } class_lms_classifier; 00055 00056 LmsClassifier::LmsClassifier() {};
1.3.3