X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Ffprobe-ulog.c;h=26eac1f33ac1e6aa17a53d64d5521b09de2d5207;hb=efa56879606236b93bff6364c7d2a929e7379eec;hp=31d1e022600973f98f631adc3f58eb484f717ad8;hpb=a2a10337384cfbcf977f7a8c0062a5c5a95ac5a5;p=fprobe-ulog.git diff --git a/src/fprobe-ulog.c b/src/fprobe-ulog.c index 31d1e02..26eac1f 100644 --- a/src/fprobe-ulog.c +++ b/src/fprobe-ulog.c @@ -378,6 +378,23 @@ inline void copy_flow(struct Flow *src, struct Flow *dst) dst->flags = src->flags; } +void get_cur_epoch() { + int fd; + fd = open("/tmp/fprobe_last_epoch",O_RDONLY); + if (fd != -1) { + char snum[7]; + ssize_t len; + len = read(fd, snum, sizeof(snum)-1); + if (len != -1) { + snum[len]='\0'; + sscanf(snum,"%d",&cur_epoch); + close(fd); + } + } + return; +} + + void update_cur_epoch_file(int n) { int fd, len; char snum[7]; @@ -1447,6 +1464,8 @@ bad_collector: peers[npeers].write_fd = START_VALUE; peers[npeers].type = PEER_FILE; peers[npeers].seq = 0; + + get_cur_epoch(); npeers++; } else