<commit_before>﻿using HexToBinLib;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;

namespace SnifferTool
{
    public partial class MainForm : Form
    {
        private const int MTU = 65535;
        private Socket socket;
        private readonly object [] protocolTypes = new object []
        {
            new { id = ProtocolType.Icmp, text = "ICMP" },
            new { id = ProtocolType.IP, text = "IP" },
            new { id = ProtocolType.Udp, text = "UDP" }
        };

        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            protocolType.DataSource = protocolTypes;
            protocolType.ValueMember = "id";
            protocolType.DisplayMember = "text";
            protocolType.SelectedValue = ProtocolType.IP;
            interfaceSelector.InterfaceDeleted += InterfaceSelector_InterfaceDeleted;
        }

        private void InterfaceSelector_InterfaceDeleted()
        {
            interfaceSelector.DeleteSelected();
            if (socket != null)
            {
                CloseRawSocket();
                MessageBox.Show(this, "Socket closed.", this.Text);
            }
        }

        private void Bind_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(interfaceSelector.Text))
            {<commit_msg>fix exception in binding to protocolTypes<commit_after>﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;

namespace SnifferTool
{
    public partial class MainForm : Form
    {
        private const int MTU = 65535;
        private Socket socket;
        private readonly List<object> protocolTypes = new List<object>
        {
            new { Value = ProtocolType.Icmp, Description = "ICMP" },
            new { Value = ProtocolType.IP, Description = "IP" },
            new { Value = ProtocolType.Udp, Description = "UDP" }
        };

        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            protocolType.ValueMember = "Value";
            protocolType.DisplayMember = "Description";
            protocolType.DataSource = protocolTypes;
            protocolType.SelectedValue = ProtocolType.IP;
            interfaceSelector.InterfaceDeleted += InterfaceSelector_InterfaceDeleted;
        }

        private void InterfaceSelector_InterfaceDeleted()
        {
            interfaceSelector.DeleteSelected();
            if (socket != null)
            {
                CloseRawSocket();
                MessageBox.Show(this, "Socket closed.", this.Text);
            }
        }

        private void Bind_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(interfaceSelector.Text))
            {
{'fraction_non_alphanumeric': 0.08575286968264687, 'fraction_numerical': 0.00337609723160027, 'mean_word_length': 1.9719157472417252, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5864504', 'n_tokens_mistral': 743, 'n_tokens_neox': 727, 'n_words': 177}