00001 /***************************************************************************** 00002 * Copyright 2005 Daniel Ferullo * 00003 * * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); * 00005 * you may not use this file except in compliance with the License. * 00006 * You may obtain a copy of the License at * 00007 * * 00008 * http://www.apache.org/licenses/LICENSE-2.0 * 00009 * * 00010 * Unless required by applicable law or agreed to in writing, software * 00011 * distributed under the License is distributed on an "AS IS" BASIS, * 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 00013 * See the License for the specific language governing permissions and * 00014 * limitations under the License. * 00015 * * 00016 *****************************************************************************/ 00017 00018 /** 00019 * @file netio_private.h 00020 * @author Daniel Ferullo (ferullo@cmu.edu) 00021 * 00022 * @brief private functions to help with communication protocol IO 00023 */ 00024 00025 #ifndef __NETIO_PRIVATE_H__ 00026 #define __NETIO_PRIVATE_H__ 00027 00028 #include "errorcodes.h" 00029 00030 /** 00031 * @brief checks that an message is as long as the length field says it is 00032 * 00033 * @param msg a pointer to the message 00034 * @param msg_len the length of msg (including header) 00035 * 00036 * @return OK if the message is ok, NOT_OK if it is to small, other neg value 00037 * otherwise 00038 */ 00039 errorcode checkMsgLen(char *msg, int msg_len); 00040 00041 #endif /* __NETIO_PRIVATE_H__ */ 00042