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

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

?? ftio.c

?? netflow,抓包
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * Copyright (c) 2001 Mark Fullmer and The Ohio State University * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *      $Id: ftio.c,v 1.47 2003/02/24 00:51:47 maf Exp $ */#include "ftconfig.h"#include "ftlib.h"#include <sys/time.h>#include <sys/types.h>#include <sys/uio.h>#include <sys/socket.h>#include <sys/resource.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/stat.h>#include <syslog.h>#include <dirent.h>#include <limits.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#include <fcntl.h>#include <zlib.h>#if HAVE_STRINGS_H #include <strings.h>#endif#if HAVE_STRING_H  #include <string.h>#endif#if HAVE_MMAP #include <sys/types.h> #include <sys/mman.h> #include <sys/stat.h>#endifint readn(register int fd, register void *ptr, register int nbytes);/* * function: ftio_init * * Initialize an ftio structure, allocating r/w buffers, zlib, etc. * On READ the header is consumed. * * flags:  FT_IO_FLAG_READ    - setup ftio for reading *         FT_IO_FLAG_WRITE   - setup ftio for writing *         FT_IO_FLAG_ZINIT   - used with FT_IO_FLAG_WRITE to signal *                              future use of compression. *         FT_IO_FLAG_NO_SWAP - used with FT_IO_FLAG_WRITE.  Normally *                              ftio_write() expects the record in *                              host format, and will return it in *                              host format.  This will disable the *                              swap operation to maximize performance *                              in certain cases. *         FT_IO_FLAG_MMAP    - use mmap() for reading flows * * ftio_close() must be called on the stream to free resources * and flush buffers on WRITE. * * returns: < 0 error *          >= 0 ok */int ftio_init(struct ftio *ftio, int fd, int flag){  int i, ret;  struct stat sb;  struct ftver ftv;  bzero(ftio, sizeof (struct ftio));  ftio->fd = fd;  ret = -1;  if (flag & FT_IO_FLAG_READ) {#if HAVE_MMAP    if (flag & FT_IO_FLAG_MMAP) {      if (fstat(ftio->fd, &sb) < 0) {         fterr_warn("stat()");         goto ftio_init_out;      }      ftio->mr_size = sb.st_size;      if ((ftio->mr = mmap((caddr_t)0L, ftio->mr_size, PROT_READ|PROT_WRITE,         MAP_PRIVATE,         ftio->fd, (off_t)0L)) == MAP_FAILED) {         fterr_warn("mmap()");         goto ftio_init_out;      }      ftio->flags |= FT_IO_FLAG_MMAP;    } /* FT_IO_FLAG_MMAP */#endif /* HAVE_MMAP */    /* load header */    if (ftiheader_read(ftio->fd, &ftio->fth) < 0) {      fterr_warnx("ftiheader_read(): failed");      goto ftio_init_out;    }    if (flag & FT_IO_FLAG_MMAP) {      ftio->d_start = ftio->fth.enc_len;      ftio->d_end = sb.st_size;    }    /* verify stream version */    if ((ftio->fth.s_version != 1) && (ftio->fth.s_version != 3)) {      fterr_warnx("Unsupported stream version %d", (int)ftio->fth.s_version);      goto ftio_init_out;    }      /* backwards compatability hack */    if ((ftio->fth.s_version == 1) && (ftio->fth.d_version == 65535))      ftio->fth.d_version = 1;    /* alloc z_buf if compression set and not using mmap */    if (!(ftio->flags & FT_IO_FLAG_MMAP)) {      if (ftio->fth.flags & FT_HEADER_FLAG_COMPRESS) {        if (!(ftio->z_buf = (char*)malloc(FT_Z_BUFSIZE))) {          fterr_warn("malloc()");          goto ftio_init_out;        }      }    }      /* calculate record size */    if ((ftio->rec_size = ftio_rec_size(ftio)) < 0) {      fterr_warnx("Unsupported record type (ftio_rec_size_");      goto ftio_init_out;    }    /* calculate FT_XFIELD* */    if ((ftio->xfield = ftio_xfield(ftio)) == -1) {      fterr_warnx("Unsupported record type (ftio_xfield)");      goto ftio_init_out;    }      /* set byte swap function */    if (!(ftio->swapf = ftio_rec_swapfunc(ftio))) {      goto ftio_init_out;    }    /* get byte for fields */    ftio_get_ver(ftio, &ftv);    fts3rec_compute_offsets(&ftio->fo, &ftv);    /*      * alloc d_buf -- 1 for compressed or strems, many for uncompressed     */    if (ftio->fth.flags & FT_HEADER_FLAG_COMPRESS)      i = ftio->rec_size;    else      i = FT_D_BUFSIZE;    if ((ftio->fth.flags & FT_HEADER_FLAG_COMPRESS) ||        (!(ftio->flags & FT_IO_FLAG_MMAP))) {      if (!(ftio->d_buf = (char*)malloc(i))) {        fterr_warn("malloc()");        goto ftio_init_out;      }    }      /* initialize zlib and set zlib initialized flag */    if (ftio->fth.flags & FT_HEADER_FLAG_COMPRESS) {        ftio->zs.zalloc = (alloc_func)0;      ftio->zs.zfree = (free_func)0;      ftio->zs.opaque = (voidpf)0;        if (inflateInit(&ftio->zs) != Z_OK) {        fterr_warnx("inflateInit(): failed");        goto ftio_init_out;      }        ftio->flags |= FT_IO_FLAG_ZINIT;#ifdef HAVE_MMAP       if (flag & FT_IO_FLAG_MMAP) {        ftio->zs.avail_in = sb.st_size - ftio->fth.enc_len;        ftio->zs.next_in = (Bytef*)ftio->mr+ftio->fth.enc_len;      }#endif /* HAVE_MMAP */      ftio->zs.avail_out = ftio->rec_size;      ftio->zs.next_out = (Bytef*)ftio->d_buf;    }    /* mark stream for reading */    ftio->flags |= FT_IO_FLAG_READ;    /* flags always valid */    ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;      ret = 0;  } else if (flag & FT_IO_FLAG_WRITE) {#if BYTE_ORDER == LITTLE_ENDIAN    ftio->fth.byte_order = FT_HEADER_LITTLE_ENDIAN;#endif /* LITTLE_ENDIAN */#if BYTE_ORDER == BIG_ENDIAN    ftio->fth.byte_order = FT_HEADER_BIG_ENDIAN;#endif /* BIG_ENDIAN */    /* alloc z_buf if compression set */    if (flag & FT_IO_FLAG_ZINIT) {      if (!(ftio->z_buf = (char*)malloc(FT_Z_BUFSIZE))) {        fterr_warn("malloc()");        goto ftio_init_out;      }      ftio->zs.zalloc = (alloc_func)0;      ftio->zs.zfree = (free_func)0;      ftio->zs.opaque = (voidpf)0;      if (deflateInit(&ftio->zs, ftio->z_level) != Z_OK) {        fterr_warnx("deflateInit(): failed");        goto ftio_init_out;      }      ftio->flags |= FT_IO_FLAG_ZINIT;      ftio->fth.flags |= FT_HEADER_FLAG_COMPRESS;      ftio->zs.next_out = (Bytef*)ftio->z_buf;      ftio->zs.avail_out = FT_Z_BUFSIZE;    /* no compression */    } else {      if (!(ftio->d_buf = (char*)malloc(FT_D_BUFSIZE))) {        fterr_warn("malloc()");        goto ftio_init_out;      }      ftio->d_end = FT_D_BUFSIZE;    }    /* mark stream for writing */    ftio->flags |= FT_IO_FLAG_WRITE;    /* flags field always valid */    ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;    /* preserve FT_IO_FLAG_NO_SWAP */    if (flag & FT_IO_FLAG_NO_SWAP)      ftio->flags |= FT_IO_FLAG_NO_SWAP;    ret = 0;  } /* write */  ftio_init_out:    if (ret) {    if (ftio->z_buf)      free (ftio->z_buf);    if (ftio->d_buf)      free (ftio->d_buf);    if (ftio->flags & FT_IO_FLAG_ZINIT)      inflateEnd(&ftio->zs);#if HAVE_MMAP    if (ftio->mr)      munmap(ftio->mr, (size_t)ftio->mr_size);#endif /* HAVE_MMAP */  } /* error */  return ret;}/* * function: ftio_set_z_level * * Set the zlib compression level for a ftio stream. */void ftio_set_z_level(struct ftio *ftio, int z_level){  ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;  if ((ftio->fth.flags & FT_HEADER_FLAG_COMPRESS) && (!z_level)) {    fterr_warnx("Compression can not be disabled");    return;  }    if ((!(ftio->fth.flags & FT_HEADER_FLAG_COMPRESS)) && (z_level)) {    fterr_warnx("Compression can not be enabled");    return;  }  ftio->z_level = z_level;  if (z_level)     if (deflateParams(&ftio->zs, ftio->z_level, Z_DEFAULT_STRATEGY) != Z_OK)      fterr_warnx("deflateParams(): failed");} /* * function: ftio_set_flows_count * * Set the # of flows for a ftio stream header */void ftio_set_flows_count(struct ftio *ftio, u_int32 n){  ftio->fth.fields |= FT_FIELD_FLOW_COUNT;  ftio->fth.flows_count = n;}/* * function: ftio_set_streaming * * Set the streaming flag for a ftio stream */void ftio_set_streaming(struct ftio *ftio, int flag){  ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;  if (flag)    ftio->fth.flags |= FT_HEADER_FLAG_STREAMING;  else    ftio->fth.flags &= ~FT_HEADER_FLAG_STREAMING;}/* * function: ftio_set_preloaded * * Set the streaming preloaded for a ftio stream */void ftio_set_preloaded(struct ftio *ftio, int flag){  ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;  if (flag)    ftio->fth.flags |= FT_HEADER_FLAG_PRELOADED;  else    ftio->fth.flags &= ~FT_HEADER_FLAG_PRELOADED;}/* * function: ftio_set_ver * * Set the version information for a ftio stream */int ftio_set_ver(struct ftio *ftio, struct ftver *ver){  ftio->fth.fields |= FT_FIELD_EX_VER;  if (ver->d_version == 8) {    ftio->fth.fields |= FT_FIELD_AGG_VER;    ftio->fth.fields |= FT_FIELD_AGG_METHOD;  }  ftio->fth.d_version = ver->d_version;  ftio->fth.s_version = ver->s_version;  ftio->fth.agg_method = ver->agg_method;  ftio->fth.agg_version = ver->agg_version;  /* calculate record size */  if ((ftio->rec_size = ftio_rec_size(ftio)) < 0) {    fterr_warnx("Unsupported record type");    ftio->fth.d_version = 0;    return -1;  }  /* set byte swap function */  if (!(ftio->swapf = ftio_rec_swapfunc(ftio))) {    return -1;  }  return 0;}/* * function: ftio_set_byte_order * * Set the byte order for a ftio stream */void ftio_set_byte_order(struct ftio *ftio, int byte_order){  ftio->fth.fields |= FT_FIELD_HEADER_FLAGS;  ftio->fth.byte_order = byte_order;}/* * function: ftio_set_debug * * Set the debug level for a ftio stream */void ftio_set_debug(struct ftio *ftio, int debug){  ftio->debug = debug;}/* * function: ftio_set_comment * * Set the header comment for a ftio stream */int ftio_set_comment(struct ftio *ftio, char *comment){  if (!comment)    return 0;  if (ftio->fth.comments)    free(ftio->fth.comments);  if (!(ftio->fth.comments = (char*)malloc(strlen(comment)+1))) {    fterr_warn("malloc()");    return -1;  }  strcpy(ftio->fth.comments, comment);  ftio->fth.fields |= FT_FIELD_COMMENTS;  return 0;}/* * function: ftio_set_cap_hostname * * Set the header capture hostname for a ftio stream */int ftio_set_cap_hostname(struct ftio *ftio, char *hostname){  if (!hostname)    return 0;  if (ftio->fth.cap_hostname)    free(ftio->fth.cap_hostname);  if (!(ftio->fth.cap_hostname = (char*)malloc(strlen(hostname)+1))) {    fterr_warn("malloc()");  }  strcpy(ftio->fth.cap_hostname, hostname);  ftio->fth.fields |= FT_FIELD_CAP_HOSTNAME;  return 0;}/* * function: ftio_set_corrupt * * Set the corrupt flows header field */void ftio_set_corrupt(struct ftio *ftio, u_int32 n){  ftio->fth.fields |= FT_FIELD_PKT_CORRUPT;  ftio->fth.pkts_corrupt = n;}/* * function: ftio_set_lost * * Set the lost flows header field */void ftio_set_lost(struct ftio *ftio, u_int32 n){  ftio->fth.fields |= FT_FIELD_FLOW_LOST;  ftio->fth.flows_lost = n;}/* * function: ftio_set_reset * * Set the reset sequence header field */void ftio_set_reset(struct ftio *ftio, u_int32 n){  ftio->fth.fields |= FT_FIELD_SEQ_RESET;  ftio->fth.seq_reset = n;}/* * function: ftio_set_xip * * Set the exporter ip header field */void ftio_set_xip(struct ftio *ftio, u_int32 ip){  ftio->fth.fields |= FT_FIELD_EXPORTER_IP;  ftio->fth.exporter_ip = ip;}/* * function: ftio_set_cap_time * * Set the header time for a ftio stream */void ftio_set_cap_time(struct ftio *ftio, u_int32 start, u_int32 end){  ftio->fth.fields |= FT_FIELD_CAP_START;  ftio->fth.fields |= FT_FIELD_CAP_END;  ftio->fth.cap_start = start;  ftio->fth.cap_end = end;}/* * function: ftio_set_cap_time_start * * Set the header time for a ftio stream */void ftio_set_cap_time_start(struct ftio *ftio, u_int32 start){  ftio->fth.fields |= FT_FIELD_CAP_START;  ftio->fth.cap_start = start;}/* * function: ftio_get_ver *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月天网站亚洲| 精品成人私密视频| 这里只有精品电影| 久久亚洲捆绑美女| 一区二区三区丝袜| 精品一区二区综合| 95精品视频在线| 欧美浪妇xxxx高跟鞋交| 欧美精品一区二区三区高清aⅴ | 亚洲国产精品久久不卡毛片| 免费观看在线色综合| 丁香另类激情小说| 欧美日韩视频专区在线播放| 久久色.com| 亚洲成人午夜影院| 国产精品一二三四区| 欧美性猛交一区二区三区精品| 欧美成人三级在线| 亚洲男人的天堂一区二区 | 精品国产一区二区三区忘忧草 | 91视频www| 日韩欧美中文字幕精品| 亚洲欧洲日韩综合一区二区| 日本伊人精品一区二区三区观看方式| 国产美女精品人人做人人爽| 欧美专区日韩专区| 亚洲国产精品高清| 久久精品国产亚洲5555| 色乱码一区二区三区88| 久久久久久免费毛片精品| 亚洲成人免费视频| 成人av高清在线| 日韩欧美一区二区不卡| 一级特黄大欧美久久久| 国产精品资源网| 777奇米四色成人影色区| 中文字幕日韩av资源站| 国产一区二区日韩精品| 欧美精品黑人性xxxx| 综合久久久久久| 国产精品亚洲午夜一区二区三区| 91福利国产精品| 中文子幕无线码一区tr| 久久国产精品露脸对白| 欧美亚洲国产bt| 亚洲人成精品久久久久| 成人午夜在线播放| 精品国产91亚洲一区二区三区婷婷 | 视频一区二区欧美| 91在线国内视频| 国产农村妇女毛片精品久久麻豆| 免费高清视频精品| 精品视频在线看| 亚洲精品国产无天堂网2021 | 亚洲男人的天堂在线aⅴ视频| 国产一区二区0| 日韩视频一区二区三区| 亚洲成在人线在线播放| 色猫猫国产区一区二在线视频| 国产欧美日韩视频一区二区| 色婷婷亚洲婷婷| 日韩毛片视频在线看| 国产a精品视频| 久久久久久电影| 国产一区美女在线| 337p日本欧洲亚洲大胆色噜噜| 另类欧美日韩国产在线| 制服丝袜一区二区三区| 五月天丁香久久| 91精品国产一区二区人妖| 天堂午夜影视日韩欧美一区二区| 在线中文字幕不卡| 一区二区理论电影在线观看| 在线免费观看不卡av| 亚洲国产欧美另类丝袜| 在线亚洲欧美专区二区| 一区二区三区鲁丝不卡| 91精品福利视频| 亚洲午夜视频在线| 欧美日本一区二区三区四区| 首页亚洲欧美制服丝腿| 日韩午夜电影av| 国产精品一线二线三线精华| 久久人人爽爽爽人久久久| 国产成人综合网| 亚洲人一二三区| 在线免费不卡电影| 日韩高清一级片| 亚洲精品在线免费观看视频| 国产美女主播视频一区| 中文字幕一区三区| 色拍拍在线精品视频8848| 亚洲一区在线观看网站| 69堂成人精品免费视频| 国内精品在线播放| 国产精品全国免费观看高清| 99精品欧美一区二区蜜桃免费 | 欧美裸体一区二区三区| 麻豆精品精品国产自在97香蕉 | 91影院在线免费观看| 一区二区日韩电影| 69堂国产成人免费视频| 国产在线观看一区二区| 国产精品成人一区二区三区夜夜夜| 91麻豆swag| 全国精品久久少妇| 亚洲国产精品传媒在线观看| 欧美性大战久久| 精品在线你懂的| 最新久久zyz资源站| 欧美日韩成人综合天天影院 | 久久久久国产精品麻豆ai换脸| 成人性色生活片免费看爆迷你毛片| 亚洲欧美日韩久久精品| 欧美一区二区三区系列电影| 国产一区激情在线| 亚洲影院理伦片| 精品国产电影一区二区 | 亚洲1区2区3区4区| 国产亚洲一区二区三区| 色久综合一二码| 国产精品自拍一区| 午夜欧美在线一二页| 国产日韩欧美精品一区| 欧美日韩一区在线观看| 国产91清纯白嫩初高中在线观看| 亚洲美女在线国产| 久久综合狠狠综合| 欧洲一区在线观看| 国产一区二区在线看| 亚洲日本丝袜连裤袜办公室| 日韩欧美在线123| av中文字幕一区| 激情图片小说一区| 亚洲午夜免费视频| 国产精品入口麻豆原神| 欧美一区二区日韩一区二区| 色综合久久中文综合久久牛| 国产乱码精品一区二区三区忘忧草| 夜夜精品视频一区二区 | 粉嫩蜜臀av国产精品网站| 午夜精品久久久久久久久久| 国产精品拍天天在线| 日韩欧美一区二区久久婷婷| 欧美亚洲一区三区| 成人免费视频国产在线观看| 久久er99精品| 丝袜美腿亚洲一区二区图片| 18欧美亚洲精品| 久久久精品日韩欧美| 9191精品国产综合久久久久久| 91日韩精品一区| 国产成人av电影在线| 免费观看一级特黄欧美大片| 亚洲一区视频在线观看视频| 日韩理论片在线| 国产欧美日韩中文久久| 精品1区2区在线观看| 日韩一级视频免费观看在线| 欧美系列一区二区| 久久久亚洲精品一区二区三区| 欧美亚洲日本一区| 色综合天天天天做夜夜夜夜做| 国产成人午夜精品5599| 国产在线播放一区二区三区| 久久国产精品99久久久久久老狼 | 3d动漫精品啪啪一区二区竹菊| 成人高清免费观看| 国产成人在线观看| 国产一区二区伦理| 精品伊人久久久久7777人| 久久精品99国产精品日本| 日产欧产美韩系列久久99| 偷拍日韩校园综合在线| 亚洲第一福利一区| 婷婷开心激情综合| 舔着乳尖日韩一区| 午夜精彩视频在线观看不卡| 亚洲成人免费观看| 天堂精品中文字幕在线| 午夜一区二区三区视频| 亚洲国产一区视频| 亚洲高清免费视频| 日韩精品一级二级| 美国欧美日韩国产在线播放| 蜜臀91精品一区二区三区| 蜜臀av一区二区| 黄色小说综合网站| 国产一区二区精品在线观看| 国产精品99久久久久久有的能看| 国产一区二区三区在线观看精品| 久久99精品久久久久久久久久久久| 久久se这里有精品| 国产精品资源网站| heyzo一本久久综合| 色激情天天射综合网| 欧美猛男男办公室激情| 日韩欧美亚洲国产精品字幕久久久| 欧美videos大乳护士334| 久久久国产精品不卡|