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

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

?? ftfile.c

?? netflow,抓包
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * 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: ftfile.c,v 1.24 2003/02/13 02:38:42 maf Exp $ */#include "ftconfig.h"#include "ftlib.h"#include <sys/time.h>#include <sys/types.h>#include <sys/uio.h>#include <sys/resource.h>#include <sys/stat.h>#include <dirent.h>#include <errno.h>#include <syslog.h>#include <limits.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#include <fcntl.h>#if HAVE_STRINGS_H #include <strings.h>#endif#if HAVE_STRING_H  #include <string.h>#endifint load_dir(char *prefix, struct ftfile_entries *fte, int flags, int *depth);extern int debug;/* * function: ftfile_entry_new *  * allocate ftfile_entry struct.  see also ftfile_entry_free*/struct ftfile_entry *ftfile_entry_new(int len){  struct ftfile_entry *e;  if (!(e = (struct ftfile_entry*)malloc(sizeof (struct ftfile_entry))))    return (struct ftfile_entry*)0L;  bzero(e, sizeof *e);  if (!(e->name = (char*)malloc(len+1))) {    free (e);    return (struct ftfile_entry*)0L;  }  return e;} /* ftfile_entry_new *//* * function: ftfile_entry_free *  * deallocate ftfile_entry struct allocated by ftfile_entry_new()*/void ftfile_entry_free(struct ftfile_entry *entry){  free(entry->name);  free(entry);} /* ftfile_entry_free *//* * function: ftfile_loadfile *  * Load filename into the file entries data structures * Files that do not match the flow-tools naming convention or * do not have the correct magic word in the header are not loaded * to prevent accidental removal. * * returns: < 0 error *          >= 0 ok */int ftfile_loadfile(struct ftfile_entries *fte, char *fname, int flags){  struct stat sb;  struct ftfile_entry *n1, *n2;  struct ftiheader head;  int fd, done, len;  if (flags & FT_FILE_INIT)    FT_TAILQ_INIT(&fte->head);  if (fname[0]) {    /* skip anything that doesn't begin with "ft" "cf" and "tmp" */    if (flags & FT_FILE_CHECKNAMES)      if ((strncmp(fname, "ft", 2)) &&         (strncmp(fname, "cf", 2)) &&         (strncmp(fname, "tmp", 3))) {        fterr_warnx("ignoring: %s", fname);        return 0;      }      /* skip tmp files? */      if (flags & FT_FILE_SKIPTMP)        if (!strncmp(fname, "tmp", 3))          return 0;    /* make sure the file is actually a flow file */    if ((fd = open (fname,  O_RDONLY, 0)) == -1) {      fterr_warn("open(%s)", fname);      return 0;    }    if (fstat(fd, &sb) < 0) {      fterr_warn("fstat(%s)", fname);      close(fd);      return -1;    }    if (ftiheader_read(fd, &head) < 0) {      fterr_warnx("ftiheader_read(%s): Failed, ignoring file.", fname);      close(fd);      return 0;    }    close (fd);  } else { /* empty filename -- stdin */    bzero(&head, sizeof head);    bzero(&sb, sizeof sb);  }  len = strlen(fname);  /* insert the entry in the list sorted by start time of flow file */  done = 0;  if (flags & FT_FILE_SORT) {    FT_TAILQ_FOREACH(n1, &fte->head, chain) {      if (n1->start > head.cap_start) {        if (!(n2 = ftfile_entry_new(len))) {          fterr_warnx("ftfile_entry_new(): failed");          return -1;        }        n2->size = sb.st_size;        n2->start = head.cap_start;        strcpy(n2->name, fname);        FT_TAILQ_INSERT_BEFORE(n1, n2, chain);        done = 1;        break;      }    } /* FT_TAILQ_FOREACH */  } /* FT_FILE_SORT */  if ((!done) || (!(flags & FT_FILE_SORT))) {    if (!(n2 = ftfile_entry_new(len))) {      fterr_warnx("ftfile_entry_new(): failed");      return -1;    }    n2->size = sb.st_size;    n2->start = head.cap_start;    strcpy(n2->name, fname);    FT_TAILQ_INSERT_TAIL(&fte->head, n2, chain);  } /* !done or !FT_FILE_SORT */  fte->num_bytes += sb.st_size;  fte->num_files ++;  return 0;} /* ftfile_loadfile *//* * function: ftfile_loaddir *  * Load directory contents into the file entries data structures * Files that do not match the flow-tools naming convention or * do not have the correct magic word in the header are not loaded * to prevent accidental removal. * * returns: < 0 error *          >= 0 ok */int ftfile_loaddir(struct ftfile_entries *fte, char *dir, int flags){  int depth, here;  DIR *dirp;  depth = 0;  if (flags & FT_FILE_INIT)    FT_TAILQ_INIT(&fte->head);  /* remember current dir */  if (!(dirp = opendir("."))) {    fterr_warn("opendir(.)");    return -1;  }  if ((here = open(".", O_RDONLY, 0)) < 0) {    fterr_warn("open(.)");    return -1;  }  /* go to working dir */  if (chdir (dir) < 0) {    fterr_warn("chdir(%s)", dir);    close(here);    closedir(dirp);    return -1;  }  /* load entries */  if (load_dir(dir, fte, flags, &depth)) {    fterr_warn("load_dir(): failed");    fchdir(here);    close(here);    closedir(dirp);    return -1;  }  if (debug)    fterr_info("ftfile_loaddir(): loaded %lu files", fte->num_files);  /* return */  if (fchdir(here) < 0) {    fterr_warn("fchdir()");    close(here);    closedir(dirp);    return -1;  }  closedir(dirp);  close(here);  return 0;} /* ftfile_loaddir *//* * function: ftfile_add_tail * * Add a file to the end of the list * * returns: < 0 error *          >= 0 ok*/int ftfile_add_tail(struct ftfile_entries *fte, char *fname, off_t size,  u_int32 start){  struct ftfile_entry *n1;  if (!(n1 = ftfile_entry_new(strlen(fname)))) {    fterr_warnx("ftfile_entry_new(): failed");    return -1;  }  n1->size = size;  n1->start = start;  strcpy(n1->name, fname);  FT_TAILQ_INSERT_TAIL(&fte->head, n1, chain);  fte->num_files ++;  fte->num_bytes += size;  return 0;} /* ftfile_add_tail *//* * function: ftfile_expire * * If doit is set, and the directory has exceeded the maximum size * of files, or maximum storage size remove files until the limits * are under the mark.  curbytes is a hint (fudge factor) to account * for the existing open flow export. * * returns: < 0 error *          >= 0 ok*/int ftfile_expire (struct ftfile_entries *fte, int doit, int curbytes){  u_int i;  struct ftfile_entry *n1;  u_int64 bytes;  /*   * if max_files is set, remove files starting at the head of the list until   * max_files <= num_files.  update num_files, num_bytes   */  i = 0;  bytes = 0;  if (fte->max_files && (fte->num_files > fte->max_files)) {    FT_TAILQ_FOREACH(n1, &fte->head, chain) {      fterr_info("remove/1 %s", n1->name);      bytes += n1->size;      ++i;      if (doit) {        FT_TAILQ_REMOVE(&fte->head, n1, chain);        if (unlink(n1->name) == -1)           fterr_warn("unlink(%s)", n1->name);        ftfile_entry_free(n1);      } /* doit */      if ((fte->num_files - i) <= fte->max_files)        break;    } /* FT_TAILQ_FOREACH */    if (doit) {      fte->num_files -= i;      fte->num_bytes -= bytes;    } /* doit */  } /* if */  if (debug)    fterr_info("remove/1 %u files", i);  i = 0;  bytes = 0;  /*   * if max_bytes is set, remove files starting at the head of the list until   * max_bytes <= num_bytes   */  if (fte->max_bytes && (fte->num_bytes+curbytes > fte->max_bytes)) {    FT_TAILQ_FOREACH(n1, &fte->head, chain) {      fterr_info("remove/2 %s", n1->name);      bytes += n1->size;      ++i;      if (doit) {        FT_TAILQ_REMOVE(&fte->head, n1, chain);        if (unlink(n1->name) == -1)           fterr_warn("unlink(%s)", n1->name);        ftfile_entry_free(n1);      } /* doit */      if ((fte->num_bytes+curbytes - bytes) <= fte->max_bytes)        break;    } /* FT_TAILQ_FOREACH */    if (doit) {      fte->num_files -= i;      fte->num_bytes -= bytes;    } /* doit */  } /* if */  if (debug)    fterr_info("remove/2 %u files", i);  return 0;} /* ftfile_expire *//* * function: ftfile_dump * * Dump the contents of the file entries data struct. * * returns: < 0 error

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区视频在线播放| 91视频免费播放| 欧美剧情片在线观看| 亚洲一区免费观看| 欧美调教femdomvk| 日韩不卡手机在线v区| 欧美videos大乳护士334| 国产麻豆午夜三级精品| 成人免费av网站| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 2017欧美狠狠色| 国产精品一区专区| 日韩伦理av电影| 欧美不卡视频一区| 欧美中文字幕一区二区三区亚洲 | 日韩一区有码在线| 色视频成人在线观看免| 亚洲午夜免费福利视频| 日韩欧美国产1| 粉嫩嫩av羞羞动漫久久久| 亚洲人成精品久久久久| 欧美高清视频在线高清观看mv色露露十八 | 亚洲免费成人av| 欧美美女一区二区| 国产精品情趣视频| 欧美日韩精品一区二区三区| 精品一区二区三区免费播放| 亚洲人成伊人成综合网小说| 欧美视频一区在线| 国产精品18久久久久久vr| 欧美日韩黄色影视| 国产suv精品一区二区6| 亚洲欧美日韩系列| 欧美一区二区三区小说| 成人三级在线视频| 日韩av一区二区三区四区| 中文欧美字幕免费| 欧美电影在线免费观看| 福利电影一区二区| 美女诱惑一区二区| 亚洲欧洲日韩在线| 欧美不卡在线视频| 日韩欧美第一区| 亚洲国产精品久久不卡毛片| 久久久777精品电影网影网 | 欧美日韩一区二区在线观看视频 | 成人免费在线播放视频| 日韩欧美www| 欧美怡红院视频| 欧美精品自拍偷拍| 久久疯狂做爰流白浆xx| 亚洲资源中文字幕| 国产精品情趣视频| 国产人伦精品一区二区| 日韩欧美国产一区二区在线播放| 96av麻豆蜜桃一区二区| 国产福利一区二区三区| 奇米色一区二区| 亚洲国产精品久久久久婷婷884 | 国产精品对白交换视频 | 亚洲人精品午夜| 国产日韩欧美亚洲| 精品国产自在久精品国产| 欧美日韩一卡二卡| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲尤物视频在线| 亚洲欧美激情在线| 国产精品一二二区| 亚洲码国产岛国毛片在线| 中文av一区二区| 国产视频一区在线播放| 久久综合丝袜日本网| 国模无码大尺度一区二区三区| 日韩国产一二三区| 日韩国产欧美三级| 日本午夜一本久久久综合| 亚洲成人www| 亚洲一区二区黄色| 亚欧色一区w666天堂| 五月天久久比比资源色| 午夜精品成人在线| 毛片基地黄久久久久久天堂| 青青草一区二区三区| 麻豆成人免费电影| 国产在线视频一区二区| 国产精品高潮呻吟| 亚洲欧美另类综合偷拍| 亚洲丝袜美腿综合| 亚洲男人的天堂在线aⅴ视频| 成人欧美一区二区三区| 亚洲综合图片区| 亚洲电影一区二区三区| 日韩国产在线观看| 99久久99久久精品免费观看 | 欧美体内she精高潮| 在线成人av影院| 精品处破学生在线二十三| 国产精品亲子乱子伦xxxx裸| 色八戒一区二区三区| 欧美中文字幕久久| 欧美一卡二卡三卡四卡| 久久中文娱乐网| 国产精品视频免费看| 玉米视频成人免费看| 视频一区二区三区中文字幕| 国内外精品视频| 成人在线视频一区二区| 成人av在线电影| 欧美日韩国产电影| 成人国产精品免费观看动漫| 在线观看欧美精品| 欧美tickling挠脚心丨vk| 日本一区二区三级电影在线观看| 亚洲免费av观看| 老司机免费视频一区二区| 成人黄色综合网站| 在线成人小视频| 蜜桃av噜噜一区| 久久国产尿小便嘘嘘| www.亚洲在线| 7777精品伊人久久久大香线蕉经典版下载 | 国产乱码一区二区三区| 色系网站成人免费| 日韩一级黄色大片| 日韩码欧中文字| 精品一区二区综合| 色一情一乱一乱一91av| 久久先锋影音av鲁色资源 | 婷婷国产v国产偷v亚洲高清| 国产精品电影院| 免费观看日韩电影| 成人教育av在线| 日韩欧美国产精品一区| 亚洲精品乱码久久久久久黑人| 国内精品自线一区二区三区视频| 在线不卡中文字幕| 欧美午夜在线一二页| 精品一区二区日韩| 国内成人免费视频| 91精品国产91综合久久蜜臀| 国产精品嫩草99a| 久久精品二区亚洲w码| 91精品办公室少妇高潮对白| 国产欧美精品一区二区色综合 | 91精品国产综合久久精品app | 欧美精品在线一区二区三区| 1000部国产精品成人观看| 狠狠色2019综合网| 日韩一区二区在线播放| 亚洲第一激情av| 色国产综合视频| 亚洲欧洲日韩一区二区三区| 亚洲品质自拍视频| 成人夜色视频网站在线观看| 26uuu亚洲综合色欧美 | 中文字幕欧美国产| 激情小说欧美图片| 日韩欧美国产一区二区三区| 日韩一区精品字幕| 一区二区免费在线播放| 石原莉奈在线亚洲三区| 欧美丝袜丝交足nylons| 亚洲丝袜制服诱惑| 97se狠狠狠综合亚洲狠狠| 亚洲人妖av一区二区| 99天天综合性| 亚洲乱码中文字幕| 日本韩国一区二区三区视频| 欧美一级精品大片| 精品一区二区三区免费毛片爱| 日韩精品在线看片z| 黄页视频在线91| 久久免费偷拍视频| 国产精品 欧美精品| 国产精品日韩成人| 99久久久久久99| 一区二区国产视频| 午夜在线电影亚洲一区| 欧美一区二区在线免费观看| 日本欧洲一区二区| 欧美电视剧在线观看完整版| 国产亚洲精品福利| 成人精品视频一区二区三区| 国产精品你懂的| 在线观看av不卡| 视频一区二区三区在线| 精品日韩一区二区| 国产成人精品亚洲777人妖| 国产婷婷色一区二区三区| www.亚洲在线| 欧美性受xxxx| 亚洲免费伊人电影| 国产一区二区免费在线| 国产精品久久久久久久久免费相片 | 亚洲国产精品人人做人人爽| 欧美精品xxxxbbbb| 国产一区二区在线电影| 国产精品久久久99| 欧美日韩国产一级| 国产一区二区在线电影|