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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? asn1.c

?? eCos操作系統(tǒng)源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
//==========================================================================////      ./lib/current/src/asn1.c//////==========================================================================//####ECOSGPLCOPYRIGHTBEGIN####// -------------------------------------------// This file is part of eCos, the Embedded Configurable Operating System.// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.//// eCos 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 or (at your option) any later version.//// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.//// As a special exception, if other files instantiate templates or use macros// or inline functions from this file, or you compile this file and link it// with other works to produce a work based on this file, this file does not// by itself cause the resulting work to be covered by the GNU General Public// License. However the source code for this file must still be made available// in accordance with section (3) of the GNU General Public License.//// This exception does not invalidate any other reasons why a work based on// this file might be covered by the GNU General Public License.//// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.// at http://sources.redhat.com/ecos/ecos-license/// -------------------------------------------//####ECOSGPLCOPYRIGHTEND####//####UCDSNMPCOPYRIGHTBEGIN####//// -------------------------------------------//// Portions of this software may have been derived from the UCD-SNMP// project,  <http://ucd-snmp.ucdavis.edu/>  from the University of// California at Davis, which was originally based on the Carnegie Mellon// University SNMP implementation.  Portions of this software are therefore// covered by the appropriate copyright disclaimers included herein.//// The release used was version 4.1.2 of May 2000.  "ucd-snmp-4.1.2"// -------------------------------------------////####UCDSNMPCOPYRIGHTEND####//==========================================================================//#####DESCRIPTIONBEGIN####//// Author(s):    hmt// Contributors: hmt// Date:         2000-05-30// Purpose:      Port of UCD-SNMP distribution to eCos.// Description:  //              ////####DESCRIPTIONEND####////==========================================================================/********************************************************************       Copyright 1989, 1991, 1992 by Carnegie Mellon University			  Derivative Work -Copyright 1996, 1998, 1999, 2000 The Regents of the University of California			 All Rights ReservedPermission to use, copy, modify and distribute this software and itsdocumentation for any purpose and without fee is hereby granted,provided that the above copyright notice appears in all copies andthat both that copyright notice and this permission notice appear insupporting documentation, and that the name of CMU and The Regents ofthe University of California not be used in advertising or publicitypertaining to distribution of the software without specific writtenpermission.CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALLWARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL CMU ORTHE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTINGFROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OFCONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR INCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*********************************************************************//* * Abstract Syntax Notation One, ASN.1 * As defined in ISO/IS 8824 and ISO/IS 8825 * This implements a subset of the above International Standards that * is sufficient to implement SNMP. * * Encodes abstract data types into a machine independent stream of bytes. * *//**********************************************************************	Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University                      All Rights ReservedPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and thatboth that copyright notice and this permission notice appear in supporting documentation, and that the name of CMU not beused in advertising or publicity pertaining to distribution of thesoftware without specific, written prior permission.  CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THISSOFTWARE.******************************************************************/#include <config.h>#ifdef KINETICS#include "gw.h"#endif#if HAVE_STRING_H#include <string.h>#else#include <strings.h>#endif#include <sys/types.h>#include <stdio.h>#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#if HAVE_WINSOCK_H#include <winsock.h>#endif#if HAVE_NETINET_IN_H#include <netinet/in.h>#endif#ifdef vms#include <in.h>#endif#if HAVE_DMALLOC_H#include <dmalloc.h>#endif#include "asn1.h"#include "int64.h"#include "snmp_debug.h"#include "mib.h"#ifndef NULL#define NULL	0#endif#include "snmp_api.h"#include "snmp_impl.h" /* to define ERROR_MSG */staticvoid _asn_size_err(const char *str, size_t wrongsize, size_t rightsize){    char ebuf[128];    sprintf(ebuf,"%s size %d: s/b %d",str, wrongsize, rightsize);    ERROR_MSG(ebuf);}staticvoid _asn_length_err(const char *str, size_t wrongsize, size_t rightsize){    char ebuf[128];    sprintf(ebuf,"%s length %d too large: exceeds %d",str, wrongsize, rightsize);    ERROR_MSG(ebuf);}/* * call after asn_parse_length to verify result. */staticint _asn_parse_length_check(const char *str,                   u_char *bufp, u_char *data,                   u_long plen, size_t dlen){    char ebuf[128];    size_t header_len;    if (bufp == NULL){	/* error message is set */	return 1;    }    header_len = bufp - data;    if (((size_t)plen + header_len) > dlen){	sprintf(ebuf, "%s: message overflow: %d len + %d delta > %d len",		str, (int)plen, (int)header_len, (int)dlen);	ERROR_MSG(ebuf);	return 1;    }    return 0;}/* * call after asn_build_header to verify result. */staticint _asn_build_header_check(const char *str, u_char *data,                      size_t datalen, size_t typedlen){    char ebuf[128];        if (data == NULL){	/* error message is set */	return 1;    }    if (datalen < typedlen){	sprintf(ebuf, "%s: bad header, length too short: %d < %d", str, datalen, typedlen);	ERROR_MSG(ebuf);	return 1;    }    return 0;}/* checks the incoming packet for validity and returns its size or 0 */intasn_check_packet (u_char *pkt, size_t len){  u_long asn_length;    if (len < 2)    return 0;      /* always too short */  if (*pkt != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR))    return -1;     /* wrong type */  if (*(pkt+1) & 0x80) {    /* long length */    if ((int)len < (int)(*(pkt+1) & ~0x80)+2)      return 0;    /* still to short, incomplete length */    asn_parse_length(pkt+1, &asn_length);    return (asn_length + 2 + (*(pkt+1) & ~0x80));  } else {    /* short length */    return (*(pkt+1) + 2);  }}staticint _asn_bitstring_check(const char * str, u_long asn_length, u_char datum){    char ebuf[128];    if (asn_length < 1){	sprintf(ebuf,"%s: length %d too small", str, (int)asn_length);	ERROR_MSG(ebuf);	return 1;    }    if (datum > 7){	sprintf(ebuf,"%s: datum %d >7: too large", str, (int)(datum));	ERROR_MSG(ebuf);	return 1;    }    return 0;}/* * asn_parse_int - pulls a long out of an ASN int type. *  On entry, datalength is input as the number of valid bytes following *   "data".  On exit, it is returned as the number of valid bytes *   following the end of this object. * *  Returns a pointer to the first byte past the end *   of this object (i.e. the start of the next object). *  Returns NULL on any error.  u_char * asn_parse_int(      u_char     *data         IN - pointer to start of object      int        *datalength   IN/OUT - number of valid bytes left in buffer      u_char     *type         OUT - asn type of object      long       *intp         IN/OUT - pointer to start of output buffer      int         intsize      IN - size of output buffer*/u_char *asn_parse_int(u_char *data,	      size_t *datalength,	      u_char *type,	      long *intp,	      size_t intsize){/* * ASN.1 integer ::= 0x02 asnlength byte {byte}* */    static const char *errpre = "parse int";    register u_char *bufp = data;    u_long	    asn_length;    register long   value = 0;    if (intsize != sizeof (long)){	_asn_size_err(errpre, intsize, sizeof(long));	return NULL;    }    *type = *bufp++;    bufp = asn_parse_length(bufp, &asn_length);    if (_asn_parse_length_check(errpre, bufp, data, asn_length, *datalength))	return NULL;    if ((size_t)asn_length > intsize){	_asn_length_err(errpre, (size_t)asn_length, intsize);	return NULL;    }    *datalength -= (int)asn_length + (bufp - data);    if (*bufp & 0x80)	value = -1; /* integer is negative */    DEBUGDUMPSETUP("dump_recv", data, bufp - data + asn_length);    while(asn_length--)	value = (value << 8) | *bufp++;    DEBUGMSG(("dump_recv", "  ASN Integer:\t%ld (0x%.2X)\n", value, value));    *intp = value;    return bufp;}/* * asn_parse_unsigned_int - pulls an unsigned long out of an ASN int type. *  On entry, datalength is input as the number of valid bytes following *   "data".  On exit, it is returned as the number of valid bytes *   following the end of this object. * *  Returns a pointer to the first byte past the end *   of this object (i.e. the start of the next object). *  Returns NULL on any error.  u_char * asn_parse_unsigned_int(      u_char     *data         IN - pointer to start of object      int        *datalength   IN/OUT - number of valid bytes left in buffer      u_char     *type         OUT - asn type of object      u_long     *intp         IN/OUT - pointer to start of output buffer      int         intsize      IN - size of output buffer */u_char *asn_parse_unsigned_int(u_char *data,		       size_t *datalength,		       u_char *type,		       u_long *intp,		       size_t intsize){/* * ASN.1 integer ::= 0x02 asnlength byte {byte}* */    static const char *errpre = "parse uint";    register u_char *bufp = data;    u_long	    asn_length;    register u_long value = 0;    if (intsize != sizeof (long)){	_asn_size_err(errpre, intsize, sizeof(long));	return NULL;    }    *type = *bufp++;    bufp = asn_parse_length(bufp, &asn_length);    if (_asn_parse_length_check(errpre, bufp, data, asn_length, *datalength))	return NULL;    if (((int)asn_length > (intsize + 1)) ||	(((int)asn_length == intsize + 1) && *bufp != 0x00)){	_asn_length_err(errpre, (size_t)asn_length, intsize);	return NULL;    }    *datalength -= (int)asn_length + (bufp - data);    if (*bufp & 0x80)	value = ~value; /* integer is negative */    DEBUGDUMPSETUP("dump_recv", data, bufp - data + asn_length);    while(asn_length--)	value = (value << 8) | *bufp++;    DEBUGMSG(("dump_recv", "  ASN UInteger:\t%ld (0x%.2X)\n", value, value));    *intp = value;    return bufp;}/* * asn_build_int - builds an ASN object containing an integer. *  On entry, datalength is input as the number of valid bytes following *   "data".  On exit, it is returned as the number of valid bytes *   following the end of this object. * *  Returns a pointer to the first byte past the end *   of this object (i.e. the start of the next object). *  Returns NULL on any error.  u_char * asn_build_int(      u_char     *data         IN - pointer to start of output buffer      int        *datalength   IN/OUT - number of valid bytes left in buffer      int         type         IN  - asn type of object      long       *intp         IN - pointer to start of long integer      int         intsize      IN - size of input buffer */u_char *asn_build_int(u_char *data,	      size_t *datalength,	      u_char type,	      long *intp,	      size_t intsize){/* * ASN.1 integer ::= 0x02 asnlength byte {byte}* */	static const char *errpre = "build int";    register long integer;    register u_long mask;    if (intsize != sizeof (long)){	_asn_size_err(errpre, intsize, sizeof(long));	return NULL;    }    integer = *intp;    /*     * Truncate "unnecessary" bytes off of the most significant end of this     * 2's complement integer.  There should be no sequence of 9     * consecutive 1's or 0's at the most significant end of the     * integer.     */    mask = ((u_long) 0x1FF) << ((8 * (sizeof(long) - 1)) - 1);    /* mask is 0xFF800000 on a big-endian machine */    while((((integer & mask) == 0) || ((integer & mask) == mask))	  && intsize > 1){	intsize--;	integer <<= 8;    }    data = asn_build_header(data, datalength, type, intsize);    if (_asn_build_header_check(errpre,data,*datalength,intsize))	return NULL;    *datalength -= intsize;    mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));    /* mask is 0xFF000000 on a big-endian machine */    while(intsize--){	*data++ = (u_char)((integer & mask) >> (8 * (sizeof(long) - 1)));	integer <<= 8;    }    return data;}/* * asn_build_unsigned_int - builds an ASN object containing an integer. *  On entry, datalength is input as the number of valid bytes following *   "data".  On exit, it is returned as the number of valid bytes *   following the end of this object. * *  Returns a pointer to the first byte past the end *   of this object (i.e. the start of the next object). *  Returns NULL on any error.  u_char * asn_build_unsigned_int(      u_char     *data         IN - pointer to start of output buffer      int        *datalength   IN/OUT - number of valid bytes left in buffer      u_char      type         IN  - asn type of object      u_long     *intp         IN - pointer to start of long integer      int         intsize      IN - size of input buffer */u_char *asn_build_unsigned_int(u_char *data,		       size_t *datalength,		       u_char type,		       u_long *intp,		       size_t intsize){/* * ASN.1 integer ::= 0x02 asnlength byte {byte}* */	static const char *errpre = "build uint";    register u_long integer;    register u_long mask;    int add_null_byte = 0;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕在线一区| 中文幕一区二区三区久久蜜桃| 一区二区三区国产| 91美女片黄在线| 亚洲成人资源在线| 欧美日韩亚洲综合一区| 免费成人你懂的| 久久久久久久久免费| 成人精品gif动图一区| 亚洲精品少妇30p| 日韩三级伦理片妻子的秘密按摩| 韩国女主播成人在线| 国产欧美综合在线观看第十页| av在线播放不卡| 日韩中文字幕不卡| 欧美大片在线观看一区二区| 国产91精品一区二区麻豆亚洲| 中文字幕人成不卡一区| 欧美高清视频不卡网| 国产精品99久久不卡二区| 亚洲视频图片小说| 91精品国产欧美一区二区| 国产成人午夜精品影院观看视频| 亚洲美女区一区| 欧美电影免费观看高清完整版| fc2成人免费人成在线观看播放| 性做久久久久久免费观看| 日韩精品中午字幕| 99精品偷自拍| 国产原创一区二区| 一区二区三区不卡视频| 久久这里都是精品| 精品视频在线看| 丁香婷婷综合网| 免费久久99精品国产| 国产精品久久久久久久裸模| 91精品国产欧美一区二区| 99久久精品国产毛片| 久久99精品视频| 亚洲自拍偷拍麻豆| 国产欧美日韩卡一| 欧美军同video69gay| 91社区在线播放| 国产成人自拍网| 九九热在线视频观看这里只有精品| 日韩伦理电影网| 国产日韩欧美在线一区| 日韩欧美在线综合网| 色视频欧美一区二区三区| 国产精品亚洲成人| 日本免费在线视频不卡一不卡二| 亚洲精品一二三区| 国产精品欧美久久久久无广告| 精品成人免费观看| 3d成人动漫网站| 在线观看av一区| 色综合久久88色综合天天免费| 国产成人夜色高潮福利影视| 久久99国产精品免费网站| 日韩电影免费在线看| 婷婷综合五月天| 午夜欧美在线一二页| 亚洲黄色片在线观看| 亚洲特黄一级片| 中文字幕一区二区视频| 亚洲国产精品黑人久久久| 久久女同精品一区二区| 欧美白人最猛性xxxxx69交| 欧美老肥妇做.爰bbww视频| 欧美日韩精品一区二区天天拍小说| 91影院在线观看| 91免费精品国自产拍在线不卡| av在线不卡免费看| av一二三不卡影片| 91一区一区三区| 在线观看网站黄不卡| 在线视频国产一区| 在线观看亚洲精品视频| 欧美午夜电影在线播放| 欧美日韩五月天| 日韩一区二区麻豆国产| 欧美一卡二卡在线观看| 欧美大尺度电影在线| 精品sm在线观看| 国产精品国产馆在线真实露脸| 亚洲精品视频在线| 亚洲高清视频中文字幕| 日韩成人一区二区| 久久精品国产99国产精品| 国产精品资源网站| 91在线免费播放| 欧美日韩在线电影| 69av一区二区三区| 欧美成人video| 国产精品三级av| 伊人开心综合网| 日本大胆欧美人术艺术动态| 精品一区二区日韩| 处破女av一区二区| 在线国产电影不卡| 91精品国产综合久久精品图片| 精品国产99国产精品| 国产精品视频观看| 亚洲国产精品天堂| 国产乱码精品一区二区三区五月婷| 大桥未久av一区二区三区中文| 色狠狠一区二区三区香蕉| 欧美三级视频在线观看| www国产精品av| 亚洲黄色录像片| 精品一区二区免费视频| 99久久久国产精品| 日韩美女一区二区三区| 亚洲三级在线播放| 日本成人中文字幕| 97精品电影院| 久久综合久久综合九色| 一区二区三区在线观看视频| 六月丁香婷婷久久| 99re视频精品| 久久久久久免费| 日韩av网站免费在线| 成人精品国产一区二区4080| 欧美一区二区在线不卡| 亚洲丝袜另类动漫二区| 裸体健美xxxx欧美裸体表演| 91色porny在线视频| 欧美大片在线观看一区二区| 一区二区三区av电影| 国产酒店精品激情| 91精品国产欧美一区二区成人| 亚洲男同1069视频| 国产乱人伦偷精品视频免下载| 欧美日韩午夜在线视频| 综合精品久久久| 国产一区二区毛片| 69av一区二区三区| 亚洲一区在线免费观看| 成人性生交大片免费看中文网站| 欧美一级高清大全免费观看| 亚洲精品免费电影| 成人激情校园春色| 久久久久国产免费免费| 美女任你摸久久| 欧美久久高跟鞋激| 亚洲一区二区欧美日韩| 91丨porny丨首页| 亚洲欧洲国产专区| 国产激情一区二区三区| 91精品国产91久久久久久一区二区| 一区二区三区四区在线| 波多野洁衣一区| 国产精品亲子乱子伦xxxx裸| 国产黑丝在线一区二区三区| 精品国产污污免费网站入口 | 久久久久久电影| 手机精品视频在线观看| 欧美色偷偷大香| 香蕉成人啪国产精品视频综合网 | 日韩女优av电影| 五月天欧美精品| 欧美日韩亚洲另类| 亚洲成在线观看| 欧美裸体一区二区三区| 婷婷丁香激情综合| 宅男在线国产精品| 日本特黄久久久高潮| 欧美一区二区三级| 乱中年女人伦av一区二区| 欧美大片一区二区三区| 久久国产综合精品| 精品99999| 丰满岳乱妇一区二区三区 | 中文字幕亚洲区| 91蝌蚪porny九色| 亚洲资源中文字幕| 制服丝袜在线91| 激情综合网激情| 国产欧美日韩精品a在线观看| 粉嫩在线一区二区三区视频| 亚洲三级久久久| 欧美午夜影院一区| 奇米影视一区二区三区小说| 欧美电视剧在线看免费| 国产精品123区| 国产精品女主播av| 91捆绑美女网站| 日本三级亚洲精品| 日韩你懂的电影在线观看| 精品一区二区三区在线观看| 欧美国产1区2区| 色婷婷综合久久久久中文 | 亚洲区小说区图片区qvod| 在线精品国精品国产尤物884a| 视频一区二区中文字幕| 久久午夜国产精品| 色综合久久久网| 韩国av一区二区| 一区二区三区免费网站| 91精品国产免费|