亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tlv.c

?? BCAST Implementation for NS2
?? C
字號:
/* *   OSPFD routing daemon *   Copyright (C) 2001 by John T. Moy *    *   This program is free software; you can redistribute it and/or *   modify it under the terms of the GNU General Public License *   as published by the Free Software Foundation; either version 2 *   of the License, or (at your option) any later version. *    *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. *    *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* This file contains the routines used to build and parse * TLVs within the body of OSPF LSAs. */#include "machdep.h"#include "spftype.h"#include "spfparam.h"#include "ip.h"#include "arch.h"#include "lshdr.h"#include "tlv.h"/* Return the length of the TLV, including header and * padding, given the length of the value within the * body. */int TLVbuf::tlen(int vlen){    int len;    len = 4*((vlen + 3)/4);    len += sizeof(TLV);    return(len);}/* Reserve space in the TLV buffer for a new TLV, * given the length of its value. Reallocate * the current buffer, copying its contents, if necessary. */TLV *TLVbuf::reserve(int vlen){    int len;    byte *end;    byte *old;    TLV *fill;    int used;    len = tlen(vlen);    end = buf + blen;    if (buf == 0) {        buf = new byte[len];	current = (TLV *)buf;	blen = len;    }    else if ((((byte *)current) + len) > end) {        old = buf;	used = ((byte *)current) - buf;	buf = new byte[len + used];	memcpy(buf, old, used);	blen = len + used;	current = (TLV *)(buf + used);	delete old;    }    // Update current length    fill = current;    memset(fill, 0, len);    current = (TLV *) (((byte *)fill) + len);    return(fill);}/* Constructor for a buffer of TLVs that is to be * parsed. */TLVbuf::TLVbuf(byte *body, int len){    buf = body;    blen = len;    current = 0;	// Indicates no TLV has been parsed}/* Get the type of the next TLV in the buffer. Subsequent * calls to other methods (like get_int()) will be used to * get the value out of the TLV. * A return of false indicates that there are no more TLVs * available. */bool TLVbuf::next_tlv(int & type){    byte *end;    TLV *next;    if (current == 0)        next = (TLV *) buf;    else        next = (TLV *) (((byte *)current) + tlen(ntoh16(current->length)));    // Check to see the entire TLV is cont ained with the buffer    end = buf + blen;    if (end < (((byte *)next) + sizeof(TLV)) ||	end < (((byte *)next) + tlen(ntoh16(next->length))))        return(false);    type = ntoh16(next->type);    current = next;    return(true);}/* Check to see that the value within the current TLV is 4 bytes, and if * so, return it as an integer. */bool TLVbuf::get_int(int32 & val){    int32 *ptr;    if (!current || ntoh16(current->length) != sizeof(int32))        return(false);    ptr = (int32 *)(current + 1);    val = ntoh32(*ptr);    return(true);}/* Check to see that the value within the current TLV is 2 bytes, and if * so, return it as an unsigned short. */bool TLVbuf::get_short(uns16 & val){    uns16 *ptr;    if (!current || ntoh16(current->length) != sizeof(uns16))        return(false);    ptr = (uns16 *)(current + 1);    val = ntoh16(*ptr);    return(true);}/* Check to see that the value within the current TLV is 1 byte, and if * so, return it. */bool TLVbuf::get_byte(byte & val){    byte *ptr;    if (!current || ntoh16(current->length) != sizeof(byte))        return(false);    ptr = (byte *)(current + 1);    val = *ptr;    return(true);}/* If there us a current TLV, return a pointer to its body and * indicate its length. A return of 0 indicates that there * was no TLV to parse. */char *TLVbuf::get_string(int & len){    if (!current)        return(0);    len = ntoh16(current->length);    return((char *)(current + 1));}/* Routines used to build an LSA body consisting of TLVs. *//* When TLVbuf originally constructed, it has no buffer * associated with it. As TLVs are added, reserve() will allocate * appropriate buffer space. */TLVbuf::TLVbuf(){    buf = 0;    blen = 0;    current = 0;}/* To re-use a TLV transmit buffer, simply set current to the * begiining of the buffer. When building the packet, current * is always pointing to the end of the TLVs that are current * in the buffer. */void TLVbuf::reset(){    current = (TLV *) buf;}/* Put a TLV with a 4-byte integer value into the buffer. */void TLVbuf::put_int(int type, int32 val){    TLV *fill;    int32 *ptr;    fill = reserve(sizeof(val));    fill->type = hton16(type);    fill->length = hton16(sizeof(val));    ptr = (int32 *)(fill + 1);    *ptr = hton32(val);}/* Put a TLV with a 2-byte integer value into the buffer. */void TLVbuf::put_short(int type, uns16 val){    TLV *fill;    uns16 *ptr;    fill = reserve(sizeof(val));    fill->type = hton16(type);    fill->length = hton16(sizeof(val));    ptr = (uns16 *)(fill + 1);    *ptr = hton16(val);}/* Put a TLV with a one byte value into the buffer. */void TLVbuf::put_byte(int type, byte val){    TLV *fill;    byte *ptr;    fill = reserve(sizeof(val));    fill->type = hton16(type);    fill->length = hton16(sizeof(val));    ptr = (byte *)(fill + 1);    *ptr = val;}/* Put a TLV with a string value into the buffer. */void TLVbuf::put_string(int type, char *str, int len){    TLV *fill;    byte *ptr;    fill = reserve(len);    fill->type = hton16(type);    fill->length = hton16(len);    ptr = (byte *)(fill + 1);    memcpy(ptr, str, len);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩一区二区三区在线观看| 91亚洲国产成人精品一区二三| 欧美视频中文字幕| 综合中文字幕亚洲| 91视频国产观看| 亚洲在线视频一区| 欧美久久一区二区| 久久aⅴ国产欧美74aaa| 久久久久97国产精华液好用吗| 成人久久18免费网站麻豆 | 亚洲gay无套男同| 欧美日韩大陆一区二区| 激情五月激情综合网| 欧美激情综合五月色丁香小说| av午夜一区麻豆| 视频一区二区三区在线| 国产香蕉久久精品综合网| 97aⅴ精品视频一二三区| 夜夜嗨av一区二区三区中文字幕| 91精品国产品国语在线不卡| 丁香天五香天堂综合| 亚洲成人福利片| 久久这里只精品最新地址| 99国产精品久久久| 免费成人美女在线观看.| 中文一区二区完整视频在线观看| 色一情一伦一子一伦一区| 日本女优在线视频一区二区 | 欧美性大战久久久久久久| 日本不卡一二三| 国产精品久久免费看| 7777精品伊人久久久大香线蕉| 成人精品小蝌蚪| 蜜桃精品视频在线| 亚洲综合清纯丝袜自拍| 久久影音资源网| 欧美色偷偷大香| 白白色 亚洲乱淫| 久久激情综合网| 一区二区三区影院| 欧美极品xxx| 精品乱人伦小说| 欧美视频在线观看一区| 国产成+人+日韩+欧美+亚洲| 午夜亚洲福利老司机| 亚洲国产精品传媒在线观看| 日韩三级视频中文字幕| 欧美在线色视频| 99精品一区二区三区| 国产一区二区美女诱惑| 丝袜a∨在线一区二区三区不卡| 国产精品国产三级国产aⅴ入口| 欧美va日韩va| 日韩一区二区三区三四区视频在线观看| av电影天堂一区二区在线| 国产精品一区二区在线观看网站 | 风间由美性色一区二区三区| 老汉av免费一区二区三区| 亚洲国产裸拍裸体视频在线观看乱了| 日本一二三不卡| 久久久精品人体av艺术| 日韩免费观看2025年上映的电影| 精品视频在线看| 91久久精品国产91性色tv| 国产aⅴ综合色| 国产福利不卡视频| 国产精品综合一区二区三区| 精品夜夜嗨av一区二区三区| 日韩av午夜在线观看| 婷婷夜色潮精品综合在线| 一区二区免费看| 亚洲精品欧美二区三区中文字幕| 日韩美女视频一区| 中文字幕一区日韩精品欧美| 国产精品久久久爽爽爽麻豆色哟哟| 国产婷婷色一区二区三区| 欧美大片拔萝卜| 精品三级av在线| 国产日韩欧美亚洲| 欧美激情一区二区三区全黄| 国产欧美日韩精品一区| 国产欧美日韩视频在线观看| 欧美激情一区二区三区不卡| 中文字幕成人在线观看| 国产精品每日更新| 国产精品国产三级国产a| 亚洲欧美一区二区三区国产精品 | 亚洲成av人片在www色猫咪| 亚洲一区二区三区国产| 午夜精品福利一区二区三区蜜桃| 日韩不卡手机在线v区| 久久成人综合网| 懂色av一区二区三区免费看| aaa亚洲精品一二三区| 色狠狠桃花综合| 911精品产国品一二三产区| 日韩欧美一二三区| 日本一区二区三区dvd视频在线| 国产精品第四页| 亚洲激情欧美激情| 视频一区国产视频| 国产精品一区三区| 色综合天天综合网天天看片| 欧美精品在欧美一区二区少妇| 精品日韩一区二区三区| 国产精品免费免费| 亚洲一区电影777| 国产一区美女在线| 91在线一区二区| 欧美一级高清片| 国产精品色一区二区三区| 亚洲综合一区在线| 激情图片小说一区| 色婷婷亚洲综合| 日韩欧美中文字幕公布| 国产精品黄色在线观看| 日韩av高清在线观看| 成人av在线播放网站| 欧美少妇一区二区| 欧美激情中文不卡| 天堂va蜜桃一区二区三区漫画版| 国产一区视频导航| 欧美色精品在线视频| 中文字幕欧美国产| 日精品一区二区| 99re热视频这里只精品| 日韩欧美一二三区| 亚洲一区二区精品视频| 国产成人免费视| 欧美精品在线视频| 亚洲人成在线播放网站岛国| 久久69国产一区二区蜜臀| 91国产视频在线观看| 中文字幕精品一区| 精品一区二区三区免费毛片爱| 在线观看日韩高清av| 欧美国产综合一区二区| 人人狠狠综合久久亚洲| 91黄色免费看| 国产精品萝li| 国产精品1024久久| 精品美女一区二区| 日韩av在线发布| 欧美精品精品一区| 亚洲国产视频一区二区| 91麻豆精东视频| 国产精品久久久久影院色老大| 久色婷婷小香蕉久久| 欧美女孩性生活视频| 亚洲精品成人悠悠色影视| av在线不卡网| 国产精品色哟哟网站| 国产成人亚洲综合a∨婷婷图片| 欧美一二三区在线观看| 日韩成人一区二区三区在线观看| 色偷偷成人一区二区三区91 | 亚洲精品国产视频| 99精品视频免费在线观看| 久久精品人人做人人综合| 久久99热这里只有精品| 日韩欧美电影在线| 久久精品国产色蜜蜜麻豆| 欧美一二三区在线| 看电影不卡的网站| 日韩一区二区电影| 美女视频黄频大全不卡视频在线播放| 欧美日韩一区二区三区免费看| 亚洲精品自拍动漫在线| 欧美伊人久久久久久午夜久久久久| 自拍偷拍欧美激情| 色猫猫国产区一区二在线视频| 一区二区三区电影在线播| 欧美艳星brazzers| 亚洲一区二区中文在线| 欧美精品丝袜中出| 日韩国产高清影视| 精品国产自在久精品国产| 狠狠色丁香久久婷婷综合丁香| ww久久中文字幕| 成人性生交大片免费看中文网站| 国产精品久久久久影院色老大| 成人免费观看av| 亚洲理论在线观看| 欧美日韩激情一区二区三区| 日韩av在线播放中文字幕| 26uuu色噜噜精品一区二区| 国产91高潮流白浆在线麻豆| 亚洲免费电影在线| 欧美喷水一区二区| 国产一区欧美日韩| 亚洲欧洲精品一区二区精品久久久| 日本久久电影网| 欧美aaaaa成人免费观看视频| 国产亚洲污的网站| 91女神在线视频| 免费观看一级欧美片| 中文乱码免费一区二区| 91福利在线免费观看| 日本欧美一区二区| 久久久精品免费免费|