<commit_before>'use strict';

/**
 * @ngdoc service
 * @name flowsimUiApp.Packet
 * @description
 * # Packet
 * Service in the flowsimUiApp.
 */

angular.module('flowsimUiApp')
  .factory('Packet', function(ETHERNET, VLAN, ARP, MPLS, IPV4, IPV6, ICMPV6,
                              TCP, UDP, SCTP, PAYLOAD) {

var Protocols = {
  Ethernet: ETHERNET,
  VLAN: VLAN,
  ARP: ARP,
  MPLS: MPLS,
  IPv4: IPV4,
  ICMPv4: ICMPV4,
  ICMPv6: ICMPV6,
  TCP: TCP,
  UDP: UDP,
  SCTP: SCTP,
  Payload: PAYLOAD
};

function Protocol(name) {
  switch(name) {
    case ETHERNET.name:
      return ETHERNET.create();
    case VLAN.name:
      return VLAN.create();
    case MPLS.name:
      return MPLS.create();
    case ARP.name:
      return ARP.create();
    case IPV4.name:
      return IPV4.create();
    case IPV6.name:
      return IPV6.create();
    case ICMPV4.name:
      return ICMPV4.create();
    case ICMPV6.name:
      return ICMPV6.create();
    case TCP.name:
      return TCP.create();
    case UDP.name:
      return UDP.create();
    case SCTP.name:
      return SCTP.create();
    case PAYLOAD.name:
      return PAYLOAD.create();
    default:
      return null;
  }
}

function ProtocolUI(protocol) {
  switch(name) {
    case ETHERNET.name:
      return ETHERNET.createUI(protocol);
    case VLAN.name:
      return VLAN.createUI(protocol);
    case MPLS.name:
      return MPLS.createUI(protocol);
    case ARP.name:
      return ARP.createUI(protocol);
    case IPV4.name:
      return IPV4.createUI(protocol);
    case IPV6.name:
      return IPV6.createUI(protocol);
    case ICMPV4.name:
      return ICMPV4.createUI(protocol);
    case ICMPV6.name:
      return ICMPV6.createUI(protocol);
    case TCP.name:
      return TCP.createUI(protocol);
    case UDP.name:
      return UDP.createUI(protocol);
    case SCTP.name:
      return SCTP.createUI(protocol);
    case PAYLOAD.name:
      return PAYLOAD.createUI(protocol);
    default:
      return null;
}

function Packet(name) {
  this.name = name;
  this.bytes = 0;
  this.protocols = [
    ETHERNET.create();
  ];<commit_msg>latest<commit_after>'use strict';

/**
 * @ngdoc service
 * @name flowsimUiApp.Packet
 * @description
 * # Packet
 * Service in the flowsimUiApp.
 */

angular.module('flowsimUiApp')
  .factory('Packet', function(ETHERNET, VLAN, ARP, MPLS, IPV4, IPV6, ICMPV6,
                              TCP, UDP, SCTP, PAYLOAD) {

var Protocols = {
  Ethernet: ETHERNET,
  VLAN: VLAN,
  ARP: ARP,
  MPLS: MPLS,
  IPv4: IPV4,
  ICMPv4: ICMPV4,
  ICMPv6: ICMPV6,
  TCP: TCP,
  UDP: UDP,
  SCTP: SCTP,
  Payload: PAYLOAD
};

function dispatch(name, method) {
  switch(name) {
    case ETHERNET.name:
      return ETHERNET[method]();
    case VLAN.name:
      return VLAN[method]();
    case MPLS.name:
      return MPLS[method]();
    case ARP.name:
      return ARP[method]();
    case IPV4.name:
      return IPV4[method]();
    case IPV6.name:
      return IPV6[method]();
    case ICMPV4.name:
      return ICMPV4[method]();
    case ICMPV6.name:
      return ICMPV6[method]();
    case TCP.name:
      return TCP[method]();
    case UDP.name:
      return UDP[method]();
    case SCTP.name:
      return SCTP[method]();
    case PAYLOAD.name:
      return PAYLOAD[method]();
    default:
      return null;
  }
}

function Protocol(name) {
  return dispatch(name, 'create');
}

function ProtocolUI(name) {
  return dispatch(name, 'createUI');
}

function Packet(name) {
  this.name = name;
  this.bytes = 0;
  this.protocols = [
    ETHERNET.create();
  ];
{'fraction_non_alphanumeric': 0.12828482622209664, 'fraction_numerical': 0.012432890647075446, 'mean_word_length': 2.6196319018404908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7236966', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1327, 'n_words': 287}