<commit_before>/*
 * This is sniffer
 * Display ethernet, ip, tcp and udp header
 */

#include <stdio.h>
#include "init.h"
#include "layer2.h"
#include "layer3.h"
#include "layer4.h"

int main(void)
{
  /* the number to capture packets (default: 5 packets) */
  int count = 5;
  /* type field of ethernet header */
  u_int type;
  /* protocol field of ipv4 header */
  u_int protocol;

  /* create socket */
  init();

  while (count-- > 0) {
    receive_packet();

    /* for layer 2 protocol */
    type = layer2();

    /* for layer 3 protocol */
    protocol = layer3(type);

    if (protocol == -1) {
      putchar('\n');
      continue;
    }

    /* for layer 4 protocol */
    layer4(protocol);

    putchar('\n');
  }

  return 0;
}
<commit_msg>modify<commit_after>/*
 * This is sniffer
 * Display ethernet, ip, tcp and udp header
 */

#include <stdio.h>
#include "init.h"
#include "layer2.h"
#include "layer3.h"
#include "layer4.h"

int main(void)
{
  /* the number to capture packets (default: 5 packets) */
  int count = 5;
  /* type field of ethernet header */
  u_int type;
  /* protocol field of ipv4 header */
  u_int protocol;

  /* create socket */
  init();

  while (count-- > 0) {
    receive_packet();

    /* for layer 2 protocol */
    type = layer2();

    /* for layer 3 protocol */
    if ((protocol = layer3(type)) == -1) {
      putchar('\n');
      continue;
    }

    /* for layer 4 protocol */
    layer4(protocol);

    putchar('\n');
  }

  return 0;
}

{'fraction_non_alphanumeric': 0.15524193548387097, 'fraction_numerical': 0.020161290322580645, 'mean_word_length': 2.4073226544622424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4947046', 'n_tokens_mistral': 544, 'n_tokens_neox': 512, 'n_words': 159}