Page MenuHomeFreeBSD
Authored By
hselasky
Jun 2 2022, 6:39 PM
Size
1 KB
Referenced Files
None
Subscribers
None
#include <stdio.h>
#include <stdint.h>
typedef uint8_t tcp_seq;
#define SEQ_LT(a,b) ((int8_t)((a) - (b)) < 0)
#ifdef SIMULATE_32BIT_LONG
static uint8_t
ulmin(uint8_t a, uint8_t b)
{
return (a < b ? a : b);
}
#else
static uint16_t
ulmin(uint16_t a, uint16_t b)
{
return (a < b ? a : b);
}
#endif
int
main()
{
int x, y;
static int last_y = -1;
static int last_x = -1;
for (x = 0; x != 256; x++) {
int num = 0;
for (y = 0; y != 256; y++) {
if (SEQ_LT(x, y)) {
if (last_x != x) {
if (last_y > -1)
printf("%d\n", (uint8_t)last_y);
printf("LT(%d, [%d ... ", (uint8_t)x, (uint8_t)y);
last_x = x;
last_y = y - 1;
int len = (int16_t)ulmin(16, (uint8_t)y - (uint8_t)x);
printf("L=%d ", len);
}
if (last_y + 1 != y) {
int len = (int16_t)ulmin(16, (uint8_t)last_y - (uint8_t)x);
printf("L=%d ", len);
printf("%d] | [%d ... ", (uint8_t)last_y, y);
len = (int16_t)ulmin(16, (uint8_t)y - (uint8_t)x);
printf("L=%d ", len);
}
last_y = y;
num++;
}
}
int len = (int16_t)ulmin(16, (uint8_t)last_y - (uint8_t)x);
printf("L=%d ", len);
printf("%d] # %d\n", (uint8_t)last_y, num);
last_y = -1;
}
return (0);
}

File Metadata

Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4812357
Default Alt Text
test7.c (1 KB)

Event Timeline