You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by rm...@apache.org on 2018/08/07 18:58:26 UTC
[1/3] metron git commit: METRON-1683 PCAP UI - Fix the download
progress bar (sardell via merrimanr) closes apache/metron#1122
Repository: metron
Updated Branches:
refs/heads/feature/METRON-1554-pcap-query-panel 037b50b9a -> 3e7785920
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts b/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts
index fdaa569..c8cb937 100644
--- a/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts
@@ -15,1738 +15,139 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { TestBed, async, inject } from '@angular/core/testing';
+import {
+ TestBed,
+ inject,
+ fakeAsync,
+ tick,
+ discardPeriodicTasks
+} from '@angular/core/testing';
import {
BaseRequestOptions,
HttpModule,
- Http,
Response,
- ResponseOptions
+ ResponseOptions,
+ XHRBackend
} from '@angular/http';
import { MockBackend } from '@angular/http/testing';
+import { Observable } from 'rxjs/Rx';
import { PcapService } from './pcap.service';
+import { PcapStatusResponse } from '../model/pcap-status-response';
import { PcapRequest } from '../model/pcap.request';
+import { fakePdml, fakePacket } from '../model/pdml.mock';
+import { fakePcapStatusResponse, fakePcapRequest } from '../model/pcap.mock';
+
+const jobId = 'job_1234567890123_4567';
+let pdmlJsonMock = fakePdml;
+pdmlJsonMock['pdml']['packet'].push(fakePacket);
describe('PcapService', () => {
beforeEach(() => {
-
TestBed.configureTestingModule({
imports: [HttpModule],
providers: [
PcapService,
- {
- provide: Http,
- useFactory: (mockBackend, options) => {
- return new Http(mockBackend, options);
- },
- deps: [MockBackend, BaseRequestOptions]
- },
+ { provide: XHRBackend, useClass: MockBackend },
MockBackend,
BaseRequestOptions
]
});
});
describe('getPackets()', () => {
- it('should return an Observable<Response>',
- inject([PcapService, MockBackend], (pcapService, mockBackend) => {
-
- let request: PcapRequest = {
- startTimeMs: 0,
- endTimeMs: 0,
- ipSrcAddr: '0.0.0.0',
- ipSrcPort: '80',
- ipDstAddr: '0.0.0.0',
- ipDstPort: '80',
- protocol: '*',
- packetFilter: '*',
- includeReverse: false,
- };
-
- mockBackend.connections.subscribe((connection) => {
- connection.mockRespond(new Response(new ResponseOptions({body: pdml_json()})));
- });
+ it('should return an Observable<Response>', inject(
+ [PcapService, XHRBackend],
+ (pcapService, mockBackend) => {
let packets;
- pcapService.getPackets(request).subscribe(r => packets = r)
- expect(packets).toBeTruthy()
- expect(packets.pdml).toBeTruthy()
- expect(packets.pdml.packet.length).toBe(1)
- expect(packets.pdml.packet[0].proto.length).toBeGreaterThan(3)
-
- console.log(packets)
- }))
-
-
- it('should ...', inject([PcapService], (service: PcapService) => {
- expect(service).toBeTruthy();
- }));
-
- })
-
-});
+ mockBackend.connections.subscribe(connection => {
+ expect(connection.request.url).toMatch(
+ /\/api\/v1\/pcap\/job_1234567890123_4567\/pdml\?page=1/
+ );
+ connection.mockRespond(
+ new Response(new ResponseOptions({ body: pdmlJsonMock }))
+ );
+ });
+ pcapService.getPackets(jobId, 1).subscribe(r => (packets = r));
+ expect(packets).toBeTruthy();
+ expect(packets.pdml).toBeTruthy();
+ expect(packets.pdml.packet.length).toBe(1);
+ expect(packets.pdml.packet[0].protos.length).toBe(3);
+ }
+ ));
+ });
+ describe('pollStatus()', () => {
+ it('should call getStatus() in intervals', fakeAsync(inject(
+ [PcapService, XHRBackend], (pcapService, mockBackend) => {
+ const responseMock: PcapStatusResponse = fakePcapStatusResponse;
+ const spy = spyOn(pcapService, 'getStatus').and.returnValue(
+ Observable.of(responseMock)
+ );
+ let response;
+
+ pcapService.pollStatus(jobId).subscribe(r => (response = r));
+ tick(4000);
+ expect(spy.calls.count()).toBe(1);
+ tick(4000);
+ expect(spy.calls.count()).toBe(2);
+ discardPeriodicTasks();
+ })
+ )
+ );
+ });
+ describe('submitRequest()', () => {
+ it('should return an Observable<PcapStatusResponse>', inject(
+ [PcapService, XHRBackend],
+ (pcapService, mockBackend) => {
+ const request: PcapRequest = fakePcapRequest;
+ const responseMock: PcapStatusResponse = fakePcapStatusResponse;
+ let response;
+
+ mockBackend.connections.subscribe(connection => {
+ expect(connection.request.url).toMatch(/\/api\/v1\/pcap\/fixed/);
+ connection.mockRespond(
+ new Response(new ResponseOptions({ body: responseMock }))
+ );
+ });
-function pdml_json() {
- return `{
- "pdml": {
- "$": {
- "version": "0",
- "creator": "wireshark/2.4.2",
- "time": "Tue Mar 27 21:55:25 2018",
- "capture_file": "./metron-platform/metron-api/src/test/resources/test-tcp-packet.pcap"
- },
- "packet": [
- {
- "proto": [
- {
- "$": {
- "name": "geninfo",
- "pos": "0",
- "showname": "General information",
- "size": "104"
- },
- "field": [
- {
- "$": {
- "name": "num",
- "pos": "0",
- "show": "1",
- "showname": "Number",
- "value": "1",
- "size": "104"
- }
- },
- {
- "$": {
- "name": "len",
- "pos": "0",
- "show": "104",
- "showname": "Frame Length",
- "value": "68",
- "size": "104"
- }
- },
- {
- "$": {
- "name": "caplen",
- "pos": "0",
- "show": "104",
- "showname": "Captured Length",
- "value": "68",
- "size": "104"
- }
- },
- {
- "$": {
- "name": "timestamp",
- "pos": "0",
- "show": "Mar 26, 2014 19:59:40.024362000 GMT",
- "showname": "Captured Time",
- "value": "1395863980.024362000",
- "size": "104"
- }
- }
- ]
- },
- {
- "$": {
- "name": "frame",
- "showname": "Frame 1: 104 bytes on wire (832 bits), 104 bytes captured (832 bits)",
- "size": "104",
- "pos": "0"
- },
- "field": [
- {
- "$": {
- "name": "frame.encap_type",
- "showname": "Encapsulation type: Ethernet (1)",
- "size": "0",
- "pos": "0",
- "show": "1"
- }
- },
- {
- "$": {
- "name": "frame.time",
- "showname": "Arrival Time: Mar 26, 2014 19:59:40.024362000 GMT",
- "size": "0",
- "pos": "0",
- "show": "Mar 26, 2014 19:59:40.024362000 GMT"
- }
- },
- {
- "$": {
- "name": "frame.offset_shift",
- "showname": "Time shift for this packet: 0.000000000 seconds",
- "size": "0",
- "pos": "0",
- "show": "0.000000000"
- }
- },
- {
- "$": {
- "name": "frame.time_epoch",
- "showname": "Epoch Time: 1395863980.024362000 seconds",
- "size": "0",
- "pos": "0",
- "show": "1395863980.024362000"
- }
- },
- {
- "$": {
- "name": "frame.time_delta",
- "showname": "Time delta from previous captured frame: 0.000000000 seconds",
- "size": "0",
- "pos": "0",
- "show": "0.000000000"
- }
- },
- {
- "$": {
- "name": "frame.time_delta_displayed",
- "showname": "Time delta from previous displayed frame: 0.000000000 seconds",
- "size": "0",
- "pos": "0",
- "show": "0.000000000"
- }
- },
- {
- "$": {
- "name": "frame.time_relative",
- "showname": "Time since reference or first frame: 0.000000000 seconds",
- "size": "0",
- "pos": "0",
- "show": "0.000000000"
- }
- },
- {
- "$": {
- "name": "frame.number",
- "showname": "Frame Number: 1",
- "size": "0",
- "pos": "0",
- "show": "1"
- }
- },
- {
- "$": {
- "name": "frame.len",
- "showname": "Frame Length: 104 bytes (832 bits)",
- "size": "0",
- "pos": "0",
- "show": "104"
- }
- },
- {
- "$": {
- "name": "frame.cap_len",
- "showname": "Capture Length: 104 bytes (832 bits)",
- "size": "0",
- "pos": "0",
- "show": "104"
- }
- },
- {
- "$": {
- "name": "frame.marked",
- "showname": "Frame is marked: False",
- "size": "0",
- "pos": "0",
- "show": "0"
- }
- },
- {
- "$": {
- "name": "frame.ignored",
- "showname": "Frame is ignored: False",
- "size": "0",
- "pos": "0",
- "show": "0"
- }
- },
- {
- "$": {
- "name": "frame.protocols",
- "showname": "Protocols in frame: eth:ethertype:ip:tcp:smtp",
- "size": "0",
- "pos": "0",
- "show": "eth:ethertype:ip:tcp:smtp"
- }
- }
- ]
- },
- {
- "$": {
- "name": "eth",
- "showname": "Ethernet II, Src: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02), Dst: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)",
- "size": "14",
- "pos": "0"
- },
- "field": [
- {
- "$": {
- "name": "eth.dst",
- "showname": "Destination: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)",
- "size": "6",
- "pos": "0",
- "show": "02:1a:c5:05:00:02",
- "value": "021ac5050002"
- },
- "field": [
- {
- "$": {
- "name": "eth.dst_resolved",
- "showname": "Destination (resolved): MS-NLB-PhysServer-26_c5:05:00:02",
- "hide": "yes",
- "size": "6",
- "pos": "0",
- "show": "MS-NLB-PhysServer-26_c5:05:00:02",
- "value": "021ac5050002"
- }
- },
- {
- "$": {
- "name": "eth.addr",
- "showname": "Address: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)",
- "size": "6",
- "pos": "0",
- "show": "02:1a:c5:05:00:02",
- "value": "021ac5050002"
- }
- },
- {
- "$": {
- "name": "eth.addr_resolved",
- "showname": "Address (resolved): MS-NLB-PhysServer-26_c5:05:00:02",
- "hide": "yes",
- "size": "6",
- "pos": "0",
- "show": "MS-NLB-PhysServer-26_c5:05:00:02",
- "value": "021ac5050002"
- }
- },
- {
- "$": {
- "name": "eth.lg",
- "showname": ".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)",
- "size": "3",
- "pos": "0",
- "show": "1",
- "value": "1",
- "unmaskedvalue": "021ac5"
- }
- },
- {
- "$": {
- "name": "eth.ig",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "pos": "0",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "021ac5"
- }
- }
- ]
- },
- {
- "$": {
- "name": "eth.src",
- "showname": "Source: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02)",
- "size": "6",
- "pos": "6",
- "show": "02:1a:c5:01:00:02",
- "value": "021ac5010002"
- },
- "field": [
- {
- "$": {
- "name": "eth.src_resolved",
- "showname": "Source (resolved): MS-NLB-PhysServer-26_c5:01:00:02",
- "hide": "yes",
- "size": "6",
- "pos": "6",
- "show": "MS-NLB-PhysServer-26_c5:01:00:02",
- "value": "021ac5010002"
- }
- },
- {
- "$": {
- "name": "eth.addr",
- "showname": "Address: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02)",
- "size": "6",
- "pos": "6",
- "show": "02:1a:c5:01:00:02",
- "value": "021ac5010002"
- }
- },
- {
- "$": {
- "name": "eth.addr_resolved",
- "showname": "Address (resolved): MS-NLB-PhysServer-26_c5:01:00:02",
- "hide": "yes",
- "size": "6",
- "pos": "6",
- "show": "MS-NLB-PhysServer-26_c5:01:00:02",
- "value": "021ac5010002"
- }
- },
- {
- "$": {
- "name": "eth.lg",
- "showname": ".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)",
- "size": "3",
- "pos": "6",
- "show": "1",
- "value": "1",
- "unmaskedvalue": "021ac5"
- }
- },
- {
- "$": {
- "name": "eth.ig",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "pos": "6",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "021ac5"
- }
- }
- ]
- },
- {
- "$": {
- "name": "eth.type",
- "showname": "Type: IPv4 (0x0800)",
- "size": "2",
- "pos": "12",
- "show": "0x00000800",
- "value": "0800"
- }
- },
- {
- "$": {
- "name": "eth.fcs",
- "showname": "Frame check sequence: 0x26469e92 [correct]",
- "size": "4",
- "pos": "100",
- "show": "0x26469e92",
- "value": "26469e92"
- }
- },
- {
- "$": {
- "name": "eth.fcs.status",
- "showname": "FCS Status: Good",
- "size": "0",
- "pos": "100",
- "show": "1"
- }
- }
- ]
- },
- {
- "$": {
- "name": "ip",
- "showname": "Internet Protocol Version 4, Src: 24.0.0.2, Dst: 24.128.0.2",
- "size": "20",
- "pos": "14"
- },
- "field": [
- {
- "$": {
- "name": "ip.version",
- "showname": "0100 .... = Version: 4",
- "size": "1",
- "pos": "14",
- "show": "4",
- "value": "4",
- "unmaskedvalue": "45"
- }
- },
- {
- "$": {
- "name": "ip.hdr_len",
- "showname": ".... 0101 = Header Length: 20 bytes (5)",
- "size": "1",
- "pos": "14",
- "show": "20",
- "value": "45"
- }
- },
- {
- "$": {
- "name": "ip.dsfield",
- "showname": "Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)",
- "size": "1",
- "pos": "15",
- "show": "0x00000000",
- "value": "00"
- },
- "field": [
- {
- "$": {
- "name": "ip.dsfield.dscp",
- "showname": "0000 00.. = Differentiated Services Codepoint: Default (0)",
- "size": "1",
- "pos": "15",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "00"
- }
- },
- {
- "$": {
- "name": "ip.dsfield.ecn",
- "showname": ".... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)",
- "size": "1",
- "pos": "15",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "00"
- }
- }
- ]
- },
- {
- "$": {
- "name": "ip.len",
- "showname": "Total Length: 86",
- "size": "2",
- "pos": "16",
- "show": "86",
- "value": "0056"
- }
- },
- {
- "$": {
- "name": "ip.id",
- "showname": "Identification: 0xcff6 (53238)",
- "size": "2",
- "pos": "18",
- "show": "0x0000cff6",
- "value": "cff6"
- }
- },
- {
- "$": {
- "name": "ip.flags",
- "showname": "Flags: 0x02 (Don't Fragment)",
- "size": "1",
- "pos": "20",
- "show": "0x00000002",
- "value": "40"
- },
- "field": [
- {
- "$": {
- "name": "ip.flags.rb",
- "showname": "0... .... = Reserved bit: Not set",
- "size": "1",
- "pos": "20",
- "show": "0",
- "value": "40"
- }
- },
- {
- "$": {
- "name": "ip.flags.df",
- "showname": ".1.. .... = Don't fragment: Set",
- "size": "1",
- "pos": "20",
- "show": "1",
- "value": "40"
- }
- },
- {
- "$": {
- "name": "ip.flags.mf",
- "showname": "..0. .... = More fragments: Not set",
- "size": "1",
- "pos": "20",
- "show": "0",
- "value": "40"
- }
- }
- ]
- },
- {
- "$": {
- "name": "ip.frag_offset",
- "showname": "Fragment offset: 0",
- "size": "2",
- "pos": "20",
- "show": "0",
- "value": "4000"
- }
- },
- {
- "$": {
- "name": "ip.ttl",
- "showname": "Time to live: 32",
- "size": "1",
- "pos": "22",
- "show": "32",
- "value": "20"
- }
- },
- {
- "$": {
- "name": "ip.proto",
- "showname": "Protocol: TCP (6)",
- "size": "1",
- "pos": "23",
- "show": "6",
- "value": "06"
- }
- },
- {
- "$": {
- "name": "ip.checksum",
- "showname": "Header checksum: 0x5a28 [validation disabled]",
- "size": "2",
- "pos": "24",
- "show": "0x00005a28",
- "value": "5a28"
- }
- },
- {
- "$": {
- "name": "ip.checksum.status",
- "showname": "Header checksum status: Unverified",
- "size": "0",
- "pos": "24",
- "show": "2"
- }
- },
- {
- "$": {
- "name": "ip.src",
- "showname": "Source: 24.0.0.2",
- "size": "4",
- "pos": "26",
- "show": "24.0.0.2",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.addr",
- "showname": "Source or Destination Address: 24.0.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "24.0.0.2",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.src_host",
- "showname": "Source Host: 24.0.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "24.0.0.2",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.host",
- "showname": "Source or Destination Host: 24.0.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "24.0.0.2",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.dst",
- "showname": "Destination: 24.128.0.2",
- "size": "4",
- "pos": "30",
- "show": "24.128.0.2",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.addr",
- "showname": "Source or Destination Address: 24.128.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "24.128.0.2",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.dst_host",
- "showname": "Destination Host: 24.128.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "24.128.0.2",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.host",
- "showname": "Source or Destination Host: 24.128.0.2",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "24.128.0.2",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "",
- "show": "Source GeoIP: United States, Woodbridge, NJ, AS7922 Comcast Cable Communications, LLC, United States, Woodbridge, NJ, AS7922 Comcast Cable Communications, LLC, 40.557598, -74.284599",
- "size": "4",
- "pos": "26",
- "value": "18000002"
- },
- "field": [
- {
- "$": {
- "name": "ip.geoip.src_country",
- "showname": "Source GeoIP Country: United States",
- "size": "4",
- "pos": "26",
- "show": "United States",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.country",
- "showname": "Source or Destination GeoIP Country: United States",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "United States",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_city",
- "showname": "Source GeoIP City: Woodbridge, NJ",
- "size": "4",
- "pos": "26",
- "show": "Woodbridge, NJ",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.city",
- "showname": "Source or Destination GeoIP City: Woodbridge, NJ",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "Woodbridge, NJ",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_asnum",
- "showname": "Source GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "size": "4",
- "pos": "26",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.asnum",
- "showname": "Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_country",
- "showname": "Source GeoIP Country: United States",
- "size": "4",
- "pos": "26",
- "show": "United States",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.country",
- "showname": "Source or Destination GeoIP Country: United States",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "United States",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_city",
- "showname": "Source GeoIP City: Woodbridge, NJ",
- "size": "4",
- "pos": "26",
- "show": "Woodbridge, NJ",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.city",
- "showname": "Source or Destination GeoIP City: Woodbridge, NJ",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "Woodbridge, NJ",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_asnum",
- "showname": "Source GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "size": "4",
- "pos": "26",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.asnum",
- "showname": "Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_lat",
- "showname": "Source GeoIP Latitude: 40.557598",
- "size": "4",
- "pos": "26",
- "show": "40.557598",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.lat",
- "showname": "Source or Destination GeoIP Latitude: 40.557598",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "40.557598",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.src_lon",
- "showname": "Source GeoIP Longitude: -74.284599",
- "size": "4",
- "pos": "26",
- "show": "-74.284599",
- "value": "18000002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.lon",
- "showname": "Source or Destination GeoIP Longitude: -74.284599",
- "hide": "yes",
- "size": "4",
- "pos": "26",
- "show": "-74.284599",
- "value": "18000002"
- }
- }
- ]
- },
- {
- "$": {
- "name": "",
- "show": "Destination GeoIP: United States, Groton, CT, AS7922 Comcast Cable Communications, LLC, United States, Groton, CT, AS7922 Comcast Cable Communications, LLC, 41.353199, -72.038597",
- "size": "4",
- "pos": "30",
- "value": "18800002"
- },
- "field": [
- {
- "$": {
- "name": "ip.geoip.dst_country",
- "showname": "Destination GeoIP Country: United States",
- "size": "4",
- "pos": "30",
- "show": "United States",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.country",
- "showname": "Source or Destination GeoIP Country: United States",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "United States",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_city",
- "showname": "Destination GeoIP City: Groton, CT",
- "size": "4",
- "pos": "30",
- "show": "Groton, CT",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.city",
- "showname": "Source or Destination GeoIP City: Groton, CT",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "Groton, CT",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_asnum",
- "showname": "Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "size": "4",
- "pos": "30",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.asnum",
- "showname": "Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_country",
- "showname": "Destination GeoIP Country: United States",
- "size": "4",
- "pos": "30",
- "show": "United States",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.country",
- "showname": "Source or Destination GeoIP Country: United States",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "United States",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_city",
- "showname": "Destination GeoIP City: Groton, CT",
- "size": "4",
- "pos": "30",
- "show": "Groton, CT",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.city",
- "showname": "Source or Destination GeoIP City: Groton, CT",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "Groton, CT",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_asnum",
- "showname": "Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "size": "4",
- "pos": "30",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.asnum",
- "showname": "Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "AS7922 Comcast Cable Communications, LLC",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_lat",
- "showname": "Destination GeoIP Latitude: 41.353199",
- "size": "4",
- "pos": "30",
- "show": "41.353199",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.lat",
- "showname": "Source or Destination GeoIP Latitude: 41.353199",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "41.353199",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.dst_lon",
- "showname": "Destination GeoIP Longitude: -72.038597",
- "size": "4",
- "pos": "30",
- "show": "-72.038597",
- "value": "18800002"
- }
- },
- {
- "$": {
- "name": "ip.geoip.lon",
- "showname": "Source or Destination GeoIP Longitude: -72.038597",
- "hide": "yes",
- "size": "4",
- "pos": "30",
- "show": "-72.038597",
- "value": "18800002"
- }
- }
- ]
- }
- ]
- },
- {
- "$": {
- "name": "tcp",
- "showname": "Transmission Control Protocol, Src Port: 2137, Dst Port: 25, Seq: 1, Ack: 1, Len: 34",
- "size": "32",
- "pos": "34"
- },
- "field": [
- {
- "$": {
- "name": "tcp.srcport",
- "showname": "Source Port: 2137",
- "size": "2",
- "pos": "34",
- "show": "2137",
- "value": "0859"
- }
- },
- {
- "$": {
- "name": "tcp.dstport",
- "showname": "Destination Port: 25",
- "size": "2",
- "pos": "36",
- "show": "25",
- "value": "0019"
- }
- },
- {
- "$": {
- "name": "tcp.port",
- "showname": "Source or Destination Port: 2137",
- "hide": "yes",
- "size": "2",
- "pos": "34",
- "show": "2137",
- "value": "0859"
- }
- },
- {
- "$": {
- "name": "tcp.port",
- "showname": "Source or Destination Port: 25",
- "hide": "yes",
- "size": "2",
- "pos": "36",
- "show": "25",
- "value": "0019"
- }
- },
- {
- "$": {
- "name": "tcp.stream",
- "showname": "Stream index: 0",
- "size": "0",
- "pos": "34",
- "show": "0"
- }
- },
- {
- "$": {
- "name": "tcp.len",
- "showname": "TCP Segment Len: 34",
- "size": "1",
- "pos": "46",
- "show": "34",
- "value": "80"
- }
- },
- {
- "$": {
- "name": "tcp.seq",
- "showname": "Sequence number: 1 (relative sequence number)",
- "size": "4",
- "pos": "38",
- "show": "1",
- "value": "f88900ce"
- }
- },
- {
- "$": {
- "name": "tcp.nxtseq",
- "showname": "Next sequence number: 35 (relative sequence number)",
- "size": "0",
- "pos": "34",
- "show": "35"
- }
- },
- {
- "$": {
- "name": "tcp.ack",
- "showname": "Acknowledgment number: 1 (relative ack number)",
- "size": "4",
- "pos": "42",
- "show": "1",
- "value": "365aa74f"
- }
- },
- {
- "$": {
- "name": "tcp.hdr_len",
- "showname": "1000 .... = Header Length: 32 bytes (8)",
- "size": "1",
- "pos": "46",
- "show": "32",
- "value": "80"
- }
- },
- {
- "$": {
- "name": "tcp.flags",
- "showname": "Flags: 0x018 (PSH, ACK)",
- "size": "2",
- "pos": "46",
- "show": "0x00000018",
- "value": "18",
- "unmaskedvalue": "8018"
- },
- "field": [
- {
- "$": {
- "name": "tcp.flags.res",
- "showname": "000. .... .... = Reserved: Not set",
- "size": "1",
- "pos": "46",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "80"
- }
- },
- {
- "$": {
- "name": "tcp.flags.ns",
- "showname": "...0 .... .... = Nonce: Not set",
- "size": "1",
- "pos": "46",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "80"
- }
- },
- {
- "$": {
- "name": "tcp.flags.cwr",
- "showname": ".... 0... .... = Congestion Window Reduced (CWR): Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.ecn",
- "showname": ".... .0.. .... = ECN-Echo: Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.urg",
- "showname": ".... ..0. .... = Urgent: Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.ack",
- "showname": ".... ...1 .... = Acknowledgment: Set",
- "size": "1",
- "pos": "47",
- "show": "1",
- "value": "1",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.push",
- "showname": ".... .... 1... = Push: Set",
- "size": "1",
- "pos": "47",
- "show": "1",
- "value": "1",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.reset",
- "showname": ".... .... .0.. = Reset: Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.syn",
- "showname": ".... .... ..0. = Syn: Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.fin",
- "showname": ".... .... ...0 = Fin: Not set",
- "size": "1",
- "pos": "47",
- "show": "0",
- "value": "0",
- "unmaskedvalue": "18"
- }
- },
- {
- "$": {
- "name": "tcp.flags.str",
- "showname": "TCP Flags: \\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7AP\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7",
- "size": "2",
- "pos": "46",
- "show": "\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7AP\\\\xc2\\\\xb7\\\\xc2\\\\xb7\\\\xc2\\\\xb7",
- "value": "8018"
- }
- }
- ]
- },
- {
- "$": {
- "name": "tcp.window_size_value",
- "showname": "Window size value: 7240",
- "size": "2",
- "pos": "48",
- "show": "7240",
- "value": "1c48"
- }
- },
- {
- "$": {
- "name": "tcp.window_size",
- "showname": "Calculated window size: 7240",
- "size": "2",
- "pos": "48",
- "show": "7240",
- "value": "1c48"
- }
- },
- {
- "$": {
- "name": "tcp.window_size_scalefactor",
- "showname": "Window size scaling factor: -1 (unknown)",
- "size": "2",
- "pos": "48",
- "show": "-1",
- "value": "1c48"
- }
- },
- {
- "$": {
- "name": "tcp.checksum",
- "showname": "Checksum: 0x681f [unverified]",
- "size": "2",
- "pos": "50",
- "show": "0x0000681f",
- "value": "681f"
- }
- },
- {
- "$": {
- "name": "tcp.checksum.status",
- "showname": "Checksum Status: Unverified",
- "size": "0",
- "pos": "50",
- "show": "2"
- }
- },
- {
- "$": {
- "name": "tcp.urgent_pointer",
- "showname": "Urgent pointer: 0",
- "size": "2",
- "pos": "52",
- "show": "0",
- "value": "0000"
- }
- },
- {
- "$": {
- "name": "tcp.options",
- "showname": "Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps",
- "size": "12",
- "pos": "54",
- "show": "01:01:08:0a:eb:83:4b:08:e8:8c:de:cb",
- "value": "0101080aeb834b08e88cdecb"
- },
- "field": [
- {
- "$": {
- "name": "tcp.options.nop",
- "showname": "TCP Option - No-Operation (NOP)",
- "size": "1",
- "pos": "54",
- "show": "01",
- "value": "01"
- },
- "field": [
- {
- "$": {
- "name": "tcp.option_kind",
- "showname": "Kind: No-Operation (1)",
- "size": "1",
- "pos": "54",
- "show": "1",
- "value": "01"
- }
- }
- ]
- },
- {
- "$": {
- "name": "tcp.options.nop",
- "showname": "TCP Option - No-Operation (NOP)",
- "size": "1",
- "pos": "55",
- "show": "01",
- "value": "01"
- },
- "field": [
- {
- "$": {
- "name": "tcp.option_kind",
- "showname": "Kind: No-Operation (1)",
- "size": "1",
- "pos": "55",
- "show": "1",
- "value": "01"
- }
- }
- ]
- },
- {
- "$": {
- "name": "tcp.options.timestamp",
- "showname": "TCP Option - Timestamps: TSval 3951250184, TSecr 3901546187",
- "size": "10",
- "pos": "56",
- "show": "08:0a:eb:83:4b:08:e8:8c:de:cb",
- "value": "080aeb834b08e88cdecb"
- },
- "field": [
- {
- "$": {
- "name": "tcp.option_kind",
- "showname": "Kind: Time Stamp Option (8)",
- "size": "1",
- "pos": "56",
- "show": "8",
- "value": "08"
- }
- },
- {
- "$": {
- "name": "tcp.option_len",
- "showname": "Length: 10",
- "size": "1",
- "pos": "57",
- "show": "10",
- "value": "0a"
- }
- },
- {
- "$": {
- "name": "tcp.options.timestamp.tsval",
- "showname": "Timestamp value: 3951250184",
- "size": "4",
- "pos": "58",
- "show": "3951250184",
- "value": "eb834b08"
- }
- },
- {
- "$": {
- "name": "tcp.options.timestamp.tsecr",
- "showname": "Timestamp echo reply: 3901546187",
- "size": "4",
- "pos": "62",
- "show": "3901546187",
- "value": "e88cdecb"
- }
- }
- ]
- }
- ]
- },
- {
- "$": {
- "name": "tcp.analysis",
- "showname": "SEQ/ACK analysis",
- "size": "0",
- "pos": "34",
- "show": "",
- "value": ""
- },
- "field": [
- {
- "$": {
- "name": "tcp.analysis.bytes_in_flight",
- "showname": "Bytes in flight: 34",
- "size": "0",
- "pos": "34",
- "show": "34"
- }
- },
- {
- "$": {
- "name": "tcp.analysis.push_bytes_sent",
- "showname": "Bytes sent since last PSH flag: 34",
- "size": "0",
- "pos": "34",
- "show": "34"
- }
- }
- ]
- },
- {
- "$": {
- "name": "tcp.payload",
- "showname": "TCP payload (34 bytes)",
- "size": "34",
- "pos": "66",
- "show": "45:48:4c:4f:20:63:6c:69:65:6e:74:2d:31:38:30:30:30:30:30:33:2e:65:78:61:6d:70:6c:65:2e:69:6e:74:0d:0a",
- "value": "45484c4f20636c69656e742d31383030303030332e6578616d706c652e696e740d0a"
- }
- }
- ]
- },
- {
- "$": {
- "name": "smtp",
- "showname": "Simple Mail Transfer Protocol",
- "size": "34",
- "pos": "66"
- },
- "field": [
- {
- "$": {
- "name": "smtp.req",
- "showname": "Request: True",
- "hide": "yes",
- "size": "0",
- "pos": "66",
- "show": "1"
- }
- },
- {
- "$": {
- "name": "smtp.command_line",
- "showname": "Command Line: EHLO client-18000003.example.int\\\\r\\\\n",
- "size": "34",
- "pos": "66",
- "show": "EHLO client-18000003.example.int\\\\xd\\\\xa",
- "value": "45484c4f20636c69656e742d31383030303030332e6578616d706c652e696e740d0a"
- },
- "field": [
- {
- "$": {
- "name": "smtp.req.command",
- "showname": "Command: EHLO",
- "size": "4",
- "pos": "66",
- "show": "EHLO",
- "value": "45484c4f"
- }
- },
- {
- "$": {
- "name": "smtp.req.parameter",
- "showname": "Request parameter: client-18000003.example.int",
- "size": "27",
- "pos": "71",
- "show": "client-18000003.example.int",
- "value": "636c69656e742d31383030303030332e6578616d706c652e696e74"
- }
- }
- ]
- }
- ]
- }
- ]
+ pcapService.submitRequest(request).subscribe(r => (response = r));
+ expect(response).toBeTruthy();
}
- ]
- }
-}
-`
-}
+ ));
+ });
-function pdml() {
- return `<?xml version="1.0" encoding="utf-8"?>
- <?xml-stylesheet type="text/xsl" href="pdml2html.xsl"?>
- <!-- You can find pdml2html.xsl in /usr/share/wireshark or at https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=pdml2html.xsl. -->
- <pdml version="0" creator="wireshark/2.4.2" time="Tue Mar 27 21:55:25 2018" capture_file="./metron-platform/metron-api/src/test/resources/test-tcp-packet.pcap">
- <packet>
- <proto name="geninfo" pos="0" showname="General information" size="104">
- <field name="num" pos="0" show="1" showname="Number" value="1" size="104"/>
- <field name="len" pos="0" show="104" showname="Frame Length" value="68" size="104"/>
- <field name="caplen" pos="0" show="104" showname="Captured Length" value="68" size="104"/>
- <field name="timestamp" pos="0" show="Mar 26, 2014 19:59:40.024362000 GMT" showname="Captured Time" value="1395863980.024362000" size="104"/>
- </proto>
- <proto name="frame" showname="Frame 1: 104 bytes on wire (832 bits), 104 bytes captured (832 bits)" size="104" pos="0">
- <field name="frame.encap_type" showname="Encapsulation type: Ethernet (1)" size="0" pos="0" show="1"/>
- <field name="frame.time" showname="Arrival Time: Mar 26, 2014 19:59:40.024362000 GMT" size="0" pos="0" show="Mar 26, 2014 19:59:40.024362000 GMT"/>
- <field name="frame.offset_shift" showname="Time shift for this packet: 0.000000000 seconds" size="0" pos="0" show="0.000000000"/>
- <field name="frame.time_epoch" showname="Epoch Time: 1395863980.024362000 seconds" size="0" pos="0" show="1395863980.024362000"/>
- <field name="frame.time_delta" showname="Time delta from previous captured frame: 0.000000000 seconds" size="0" pos="0" show="0.000000000"/>
- <field name="frame.time_delta_displayed" showname="Time delta from previous displayed frame: 0.000000000 seconds" size="0" pos="0" show="0.000000000"/>
- <field name="frame.time_relative" showname="Time since reference or first frame: 0.000000000 seconds" size="0" pos="0" show="0.000000000"/>
- <field name="frame.number" showname="Frame Number: 1" size="0" pos="0" show="1"/>
- <field name="frame.len" showname="Frame Length: 104 bytes (832 bits)" size="0" pos="0" show="104"/>
- <field name="frame.cap_len" showname="Capture Length: 104 bytes (832 bits)" size="0" pos="0" show="104"/>
- <field name="frame.marked" showname="Frame is marked: False" size="0" pos="0" show="0"/>
- <field name="frame.ignored" showname="Frame is ignored: False" size="0" pos="0" show="0"/>
- <field name="frame.protocols" showname="Protocols in frame: eth:ethertype:ip:tcp:smtp" size="0" pos="0" show="eth:ethertype:ip:tcp:smtp"/>
- </proto>
- <proto name="eth" showname="Ethernet II, Src: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02), Dst: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)" size="14" pos="0">
- <field name="eth.dst" showname="Destination: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)" size="6" pos="0" show="02:1a:c5:05:00:02" value="021ac5050002">
- <field name="eth.dst_resolved" showname="Destination (resolved): MS-NLB-PhysServer-26_c5:05:00:02" hide="yes" size="6" pos="0" show="MS-NLB-PhysServer-26_c5:05:00:02" value="021ac5050002"/>
- <field name="eth.addr" showname="Address: MS-NLB-PhysServer-26_c5:05:00:02 (02:1a:c5:05:00:02)" size="6" pos="0" show="02:1a:c5:05:00:02" value="021ac5050002"/>
- <field name="eth.addr_resolved" showname="Address (resolved): MS-NLB-PhysServer-26_c5:05:00:02" hide="yes" size="6" pos="0" show="MS-NLB-PhysServer-26_c5:05:00:02" value="021ac5050002"/>
- <field name="eth.lg" showname=".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)" size="3" pos="0" show="1" value="1" unmaskedvalue="021ac5"/>
- <field name="eth.ig" showname=".... ...0 .... .... .... .... = IG bit: Individual address (unicast)" size="3" pos="0" show="0" value="0" unmaskedvalue="021ac5"/>
- </field>
- <field name="eth.src" showname="Source: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02)" size="6" pos="6" show="02:1a:c5:01:00:02" value="021ac5010002">
- <field name="eth.src_resolved" showname="Source (resolved): MS-NLB-PhysServer-26_c5:01:00:02" hide="yes" size="6" pos="6" show="MS-NLB-PhysServer-26_c5:01:00:02" value="021ac5010002"/>
- <field name="eth.addr" showname="Address: MS-NLB-PhysServer-26_c5:01:00:02 (02:1a:c5:01:00:02)" size="6" pos="6" show="02:1a:c5:01:00:02" value="021ac5010002"/>
- <field name="eth.addr_resolved" showname="Address (resolved): MS-NLB-PhysServer-26_c5:01:00:02" hide="yes" size="6" pos="6" show="MS-NLB-PhysServer-26_c5:01:00:02" value="021ac5010002"/>
- <field name="eth.lg" showname=".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)" size="3" pos="6" show="1" value="1" unmaskedvalue="021ac5"/>
- <field name="eth.ig" showname=".... ...0 .... .... .... .... = IG bit: Individual address (unicast)" size="3" pos="6" show="0" value="0" unmaskedvalue="021ac5"/>
- </field>
- <field name="eth.type" showname="Type: IPv4 (0x0800)" size="2" pos="12" show="0x00000800" value="0800"/>
- <field name="eth.fcs" showname="Frame check sequence: 0x26469e92 [correct]" size="4" pos="100" show="0x26469e92" value="26469e92"/>
- <field name="eth.fcs.status" showname="FCS Status: Good" size="0" pos="100" show="1"/>
- </proto>
- <proto name="ip" showname="Internet Protocol Version 4, Src: 24.0.0.2, Dst: 24.128.0.2" size="20" pos="14">
- <field name="ip.version" showname="0100 .... = Version: 4" size="1" pos="14" show="4" value="4" unmaskedvalue="45"/>
- <field name="ip.hdr_len" showname=".... 0101 = Header Length: 20 bytes (5)" size="1" pos="14" show="20" value="45"/>
- <field name="ip.dsfield" showname="Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)" size="1" pos="15" show="0x00000000" value="00">
- <field name="ip.dsfield.dscp" showname="0000 00.. = Differentiated Services Codepoint: Default (0)" size="1" pos="15" show="0" value="0" unmaskedvalue="00"/>
- <field name="ip.dsfield.ecn" showname=".... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)" size="1" pos="15" show="0" value="0" unmaskedvalue="00"/>
- </field>
- <field name="ip.len" showname="Total Length: 86" size="2" pos="16" show="86" value="0056"/>
- <field name="ip.id" showname="Identification: 0xcff6 (53238)" size="2" pos="18" show="0x0000cff6" value="cff6"/>
- <field name="ip.flags" showname="Flags: 0x02 (Don't Fragment)" size="1" pos="20" show="0x00000002" value="40">
- <field name="ip.flags.rb" showname="0... .... = Reserved bit: Not set" size="1" pos="20" show="0" value="40"/>
- <field name="ip.flags.df" showname=".1.. .... = Don't fragment: Set" size="1" pos="20" show="1" value="40"/>
- <field name="ip.flags.mf" showname="..0. .... = More fragments: Not set" size="1" pos="20" show="0" value="40"/>
- </field>
- <field name="ip.frag_offset" showname="Fragment offset: 0" size="2" pos="20" show="0" value="4000"/>
- <field name="ip.ttl" showname="Time to live: 32" size="1" pos="22" show="32" value="20"/>
- <field name="ip.proto" showname="Protocol: TCP (6)" size="1" pos="23" show="6" value="06"/>
- <field name="ip.checksum" showname="Header checksum: 0x5a28 [validation disabled]" size="2" pos="24" show="0x00005a28" value="5a28"/>
- <field name="ip.checksum.status" showname="Header checksum status: Unverified" size="0" pos="24" show="2"/>
- <field name="ip.src" showname="Source: 24.0.0.2" size="4" pos="26" show="24.0.0.2" value="18000002"/>
- <field name="ip.addr" showname="Source or Destination Address: 24.0.0.2" hide="yes" size="4" pos="26" show="24.0.0.2" value="18000002"/>
- <field name="ip.src_host" showname="Source Host: 24.0.0.2" hide="yes" size="4" pos="26" show="24.0.0.2" value="18000002"/>
- <field name="ip.host" showname="Source or Destination Host: 24.0.0.2" hide="yes" size="4" pos="26" show="24.0.0.2" value="18000002"/>
- <field name="ip.dst" showname="Destination: 24.128.0.2" size="4" pos="30" show="24.128.0.2" value="18800002"/>
- <field name="ip.addr" showname="Source or Destination Address: 24.128.0.2" hide="yes" size="4" pos="30" show="24.128.0.2" value="18800002"/>
- <field name="ip.dst_host" showname="Destination Host: 24.128.0.2" hide="yes" size="4" pos="30" show="24.128.0.2" value="18800002"/>
- <field name="ip.host" showname="Source or Destination Host: 24.128.0.2" hide="yes" size="4" pos="30" show="24.128.0.2" value="18800002"/>
- <field name="" show="Source GeoIP: United States, Woodbridge, NJ, AS7922 Comcast Cable Communications, LLC, United States, Woodbridge, NJ, AS7922 Comcast Cable Communications, LLC, 40.557598, -74.284599" size="4" pos="26" value="18000002">
- <field name="ip.geoip.src_country" showname="Source GeoIP Country: United States" size="4" pos="26" show="United States" value="18000002"/>
- <field name="ip.geoip.country" showname="Source or Destination GeoIP Country: United States" hide="yes" size="4" pos="26" show="United States" value="18000002"/>
- <field name="ip.geoip.src_city" showname="Source GeoIP City: Woodbridge, NJ" size="4" pos="26" show="Woodbridge, NJ" value="18000002"/>
- <field name="ip.geoip.city" showname="Source or Destination GeoIP City: Woodbridge, NJ" hide="yes" size="4" pos="26" show="Woodbridge, NJ" value="18000002"/>
- <field name="ip.geoip.src_asnum" showname="Source GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" size="4" pos="26" show="AS7922 Comcast Cable Communications, LLC" value="18000002"/>
- <field name="ip.geoip.asnum" showname="Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" hide="yes" size="4" pos="26" show="AS7922 Comcast Cable Communications, LLC" value="18000002"/>
- <field name="ip.geoip.src_country" showname="Source GeoIP Country: United States" size="4" pos="26" show="United States" value="18000002"/>
- <field name="ip.geoip.country" showname="Source or Destination GeoIP Country: United States" hide="yes" size="4" pos="26" show="United States" value="18000002"/>
- <field name="ip.geoip.src_city" showname="Source GeoIP City: Woodbridge, NJ" size="4" pos="26" show="Woodbridge, NJ" value="18000002"/>
- <field name="ip.geoip.city" showname="Source or Destination GeoIP City: Woodbridge, NJ" hide="yes" size="4" pos="26" show="Woodbridge, NJ" value="18000002"/>
- <field name="ip.geoip.src_asnum" showname="Source GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" size="4" pos="26" show="AS7922 Comcast Cable Communications, LLC" value="18000002"/>
- <field name="ip.geoip.asnum" showname="Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" hide="yes" size="4" pos="26" show="AS7922 Comcast Cable Communications, LLC" value="18000002"/>
- <field name="ip.geoip.src_lat" showname="Source GeoIP Latitude: 40.557598" size="4" pos="26" show="40.557598" value="18000002"/>
- <field name="ip.geoip.lat" showname="Source or Destination GeoIP Latitude: 40.557598" hide="yes" size="4" pos="26" show="40.557598" value="18000002"/>
- <field name="ip.geoip.src_lon" showname="Source GeoIP Longitude: -74.284599" size="4" pos="26" show="-74.284599" value="18000002"/>
- <field name="ip.geoip.lon" showname="Source or Destination GeoIP Longitude: -74.284599" hide="yes" size="4" pos="26" show="-74.284599" value="18000002"/>
- </field>
- <field name="" show="Destination GeoIP: United States, Groton, CT, AS7922 Comcast Cable Communications, LLC, United States, Groton, CT, AS7922 Comcast Cable Communications, LLC, 41.353199, -72.038597" size="4" pos="30" value="18800002">
- <field name="ip.geoip.dst_country" showname="Destination GeoIP Country: United States" size="4" pos="30" show="United States" value="18800002"/>
- <field name="ip.geoip.country" showname="Source or Destination GeoIP Country: United States" hide="yes" size="4" pos="30" show="United States" value="18800002"/>
- <field name="ip.geoip.dst_city" showname="Destination GeoIP City: Groton, CT" size="4" pos="30" show="Groton, CT" value="18800002"/>
- <field name="ip.geoip.city" showname="Source or Destination GeoIP City: Groton, CT" hide="yes" size="4" pos="30" show="Groton, CT" value="18800002"/>
- <field name="ip.geoip.dst_asnum" showname="Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" size="4" pos="30" show="AS7922 Comcast Cable Communications, LLC" value="18800002"/>
- <field name="ip.geoip.asnum" showname="Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" hide="yes" size="4" pos="30" show="AS7922 Comcast Cable Communications, LLC" value="18800002"/>
- <field name="ip.geoip.dst_country" showname="Destination GeoIP Country: United States" size="4" pos="30" show="United States" value="18800002"/>
- <field name="ip.geoip.country" showname="Source or Destination GeoIP Country: United States" hide="yes" size="4" pos="30" show="United States" value="18800002"/>
- <field name="ip.geoip.dst_city" showname="Destination GeoIP City: Groton, CT" size="4" pos="30" show="Groton, CT" value="18800002"/>
- <field name="ip.geoip.city" showname="Source or Destination GeoIP City: Groton, CT" hide="yes" size="4" pos="30" show="Groton, CT" value="18800002"/>
- <field name="ip.geoip.dst_asnum" showname="Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" size="4" pos="30" show="AS7922 Comcast Cable Communications, LLC" value="18800002"/>
- <field name="ip.geoip.asnum" showname="Source or Destination GeoIP AS Number: AS7922 Comcast Cable Communications, LLC" hide="yes" size="4" pos="30" show="AS7922 Comcast Cable Communications, LLC" value="18800002"/>
- <field name="ip.geoip.dst_lat" showname="Destination GeoIP Latitude: 41.353199" size="4" pos="30" show="41.353199" value="18800002"/>
- <field name="ip.geoip.lat" showname="Source or Destination GeoIP Latitude: 41.353199" hide="yes" size="4" pos="30" show="41.353199" value="18800002"/>
- <field name="ip.geoip.dst_lon" showname="Destination GeoIP Longitude: -72.038597" size="4" pos="30" show="-72.038597" value="18800002"/>
- <field name="ip.geoip.lon" showname="Source or Destination GeoIP Longitude: -72.038597" hide="yes" size="4" pos="30" show="-72.038597" value="18800002"/>
- </field>
- </proto>
- <proto name="tcp" showname="Transmission Control Protocol, Src Port: 2137, Dst Port: 25, Seq: 1, Ack: 1, Len: 34" size="32" pos="34">
- <field name="tcp.srcport" showname="Source Port: 2137" size="2" pos="34" show="2137" value="0859"/>
- <field name="tcp.dstport" showname="Destination Port: 25" size="2" pos="36" show="25" value="0019"/>
- <field name="tcp.port" showname="Source or Destination Port: 2137" hide="yes" size="2" pos="34" show="2137" value="0859"/>
- <field name="tcp.port" showname="Source or Destination Port: 25" hide="yes" size="2" pos="36" show="25" value="0019"/>
- <field name="tcp.stream" showname="Stream index: 0" size="0" pos="34" show="0"/>
- <field name="tcp.len" showname="TCP Segment Len: 34" size="1" pos="46" show="34" value="80"/>
- <field name="tcp.seq" showname="Sequence number: 1 (relative sequence number)" size="4" pos="38" show="1" value="f88900ce"/>
- <field name="tcp.nxtseq" showname="Next sequence number: 35 (relative sequence number)" size="0" pos="34" show="35"/>
- <field name="tcp.ack" showname="Acknowledgment number: 1 (relative ack number)" size="4" pos="42" show="1" value="365aa74f"/>
- <field name="tcp.hdr_len" showname="1000 .... = Header Length: 32 bytes (8)" size="1" pos="46" show="32" value="80"/>
- <field name="tcp.flags" showname="Flags: 0x018 (PSH, ACK)" size="2" pos="46" show="0x00000018" value="18" unmaskedvalue="8018">
- <field name="tcp.flags.res" showname="000. .... .... = Reserved: Not set" size="1" pos="46" show="0" value="0" unmaskedvalue="80"/>
- <field name="tcp.flags.ns" showname="...0 .... .... = Nonce: Not set" size="1" pos="46" show="0" value="0" unmaskedvalue="80"/>
- <field name="tcp.flags.cwr" showname=".... 0... .... = Congestion Window Reduced (CWR): Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.ecn" showname=".... .0.. .... = ECN-Echo: Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.urg" showname=".... ..0. .... = Urgent: Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.ack" showname=".... ...1 .... = Acknowledgment: Set" size="1" pos="47" show="1" value="1" unmaskedvalue="18"/>
- <field name="tcp.flags.push" showname=".... .... 1... = Push: Set" size="1" pos="47" show="1" value="1" unmaskedvalue="18"/>
- <field name="tcp.flags.reset" showname=".... .... .0.. = Reset: Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.syn" showname=".... .... ..0. = Syn: Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.fin" showname=".... .... ...0 = Fin: Not set" size="1" pos="47" show="0" value="0" unmaskedvalue="18"/>
- <field name="tcp.flags.str" showname="TCP Flags: \\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7AP\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7" size="2" pos="46" show="\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7AP\\xc2\\xb7\\xc2\\xb7\\xc2\\xb7" value="8018"/>
- </field>
- <field name="tcp.window_size_value" showname="Window size value: 7240" size="2" pos="48" show="7240" value="1c48"/>
- <field name="tcp.window_size" showname="Calculated window size: 7240" size="2" pos="48" show="7240" value="1c48"/>
- <field name="tcp.window_size_scalefactor" showname="Window size scaling factor: -1 (unknown)" size="2" pos="48" show="-1" value="1c48"/>
- <field name="tcp.checksum" showname="Checksum: 0x681f [unverified]" size="2" pos="50" show="0x0000681f" value="681f"/>
- <field name="tcp.checksum.status" showname="Checksum Status: Unverified" size="0" pos="50" show="2"/>
- <field name="tcp.urgent_pointer" showname="Urgent pointer: 0" size="2" pos="52" show="0" value="0000"/>
- <field name="tcp.options" showname="Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps" size="12" pos="54" show="01:01:08:0a:eb:83:4b:08:e8:8c:de:cb" value="0101080aeb834b08e88cdecb">
- <field name="tcp.options.nop" showname="TCP Option - No-Operation (NOP)" size="1" pos="54" show="01" value="01">
- <field name="tcp.option_kind" showname="Kind: No-Operation (1)" size="1" pos="54" show="1" value="01"/>
- </field>
- <field name="tcp.options.nop" showname="TCP Option - No-Operation (NOP)" size="1" pos="55" show="01" value="01">
- <field name="tcp.option_kind" showname="Kind: No-Operation (1)" size="1" pos="55" show="1" value="01"/>
- </field>
- <field name="tcp.options.timestamp" showname="TCP Option - Timestamps: TSval 3951250184, TSecr 3901546187" size="10" pos="56" show="08:0a:eb:83:4b:08:e8:8c:de:cb" value="080aeb834b08e88cdecb">
- <field name="tcp.option_kind" showname="Kind: Time Stamp Option (8)" size="1" pos="56" show="8" value="08"/>
- <field name="tcp.option_len" showname="Length: 10" size="1" pos="57" show="10" value="0a"/>
- <field name="tcp.options.timestamp.tsval" showname="Timestamp value: 3951250184" size="4" pos="58" show="3951250184" value="eb834b08"/>
- <field name="tcp.options.timestamp.tsecr" showname="Timestamp echo reply: 3901546187" size="4" pos="62" show="3901546187" value="e88cdecb"/>
- </field>
- </field>
- <field name="tcp.analysis" showname="SEQ/ACK analysis" size="0" pos="34" show="" value="">
- <field name="tcp.analysis.bytes_in_flight" showname="Bytes in flight: 34" size="0" pos="34" show="34"/>
- <field name="tcp.analysis.push_bytes_sent" showname="Bytes sent since last PSH flag: 34" size="0" pos="34" show="34"/>
- </field>
- <field name="tcp.payload" showname="TCP payload (34 bytes)" size="34" pos="66" show="45:48:4c:4f:20:63:6c:69:65:6e:74:2d:31:38:30:30:30:30:30:33:2e:65:78:61:6d:70:6c:65:2e:69:6e:74:0d:0a" value="45484c4f20636c69656e742d31383030303030332e6578616d706c652e696e740d0a"/>
- </proto>
- <proto name="smtp" showname="Simple Mail Transfer Protocol" size="34" pos="66">
- <field name="smtp.req" showname="Request: True" hide="yes" size="0" pos="66" show="1"/>
- <field name="smtp.command_line" showname="Command Line: EHLO client-18000003.example.int\\r\\n" size="34" pos="66" show="EHLO client-18000003.example.int\\xd\\xa" value="45484c4f20636c69656e742d31383030303030332e6578616d706c652e696e740d0a">
- <field name="smtp.req.command" showname="Command: EHLO" size="4" pos="66" show="EHLO" value="45484c4f"/>
- <field name="smtp.req.parameter" showname="Request parameter: client-18000003.example.int" size="27" pos="71" show="client-18000003.example.int" value="636c69656e742d31383030303030332e6578616d706c652e696e74"/>
- </field>
- </proto>
- </packet>
+ describe('getStatus()', () => {
+ it('should return an Observable<PcapStatusResponse>', inject(
+ [PcapService, XHRBackend],
+ (pcapService, mockBackend) => {
+ const responseMock: PcapStatusResponse = fakePcapStatusResponse;
+ let response;
+
+ mockBackend.connections.subscribe(connection => {
+ expect(connection.request.url).toMatch(
+ /\/api\/v1\/pcap\/job_1234567890123_4567/
+ );
+ connection.mockRespond(
+ new Response(new ResponseOptions({ body: responseMock }))
+ );
+ });
+ pcapService.getStatus(jobId).subscribe(r => (response = r));
+ expect(response).toBeTruthy();
+ }
+ ));
+ });
- </pdml>`
-}
\ No newline at end of file
+ describe('getDownloadUrl()', () => {
+ it('should return a url with the correct page to download the pdml', inject(
+ [PcapService],
+ pcapService => {
+ expect(pcapService.getDownloadUrl(jobId, 2)).toBe(
+ `/api/v1/pcap/job_1234567890123_4567/raw?page=2`
+ );
+ }
+ ));
+ });
+});
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts b/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts
index 0bbcef2..6418ad0 100644
--- a/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts
@@ -42,10 +42,9 @@ export class PcapService {
}
public submitRequest(pcapRequest: PcapRequest): Observable<PcapStatusResponse> {
- return this.http.post('/api/v1/pcap/fixed', pcapRequest, new RequestOptions({headers: new Headers(this.defaultHeaders)}))
- .map(result => result.json() as PcapStatusResponse)
- .catch(HttpUtil.handleError)
- .onErrorResumeNext();
+ return this.http.post('/api/v1/pcap/fixed', pcapRequest, new RequestOptions({headers: new Headers(this.defaultHeaders)}))
+ .map(HttpUtil.extractData)
+ .catch(HttpUtil.handleError);
}
public getStatus(id: string): Observable<PcapStatusResponse> {
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/environments/environment.e2e.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/environments/environment.e2e.ts b/metron-interface/metron-alerts/src/environments/environment.e2e.ts
index ebede73..9a11443 100644
--- a/metron-interface/metron-alerts/src/environments/environment.e2e.ts
+++ b/metron-interface/metron-alerts/src/environments/environment.e2e.ts
@@ -18,5 +18,6 @@
export const environment = {
production: false,
indices: 'alerts_ui_e2e,metaalert',
- defaultPollingState: true
+ defaultPollingState: true,
+ noTransition: true
};
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/environments/environment.prod.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/environments/environment.prod.ts b/metron-interface/metron-alerts/src/environments/environment.prod.ts
index 5f082a8..0cd6fb3 100644
--- a/metron-interface/metron-alerts/src/environments/environment.prod.ts
+++ b/metron-interface/metron-alerts/src/environments/environment.prod.ts
@@ -18,5 +18,6 @@
export const environment = {
production: true,
indices: null,
- defaultPollingState: false
+ defaultPollingState: false,
+ noTransition: false
};
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/environments/environment.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/environments/environment.ts b/metron-interface/metron-alerts/src/environments/environment.ts
index b079ab8..bd79959 100644
--- a/metron-interface/metron-alerts/src/environments/environment.ts
+++ b/metron-interface/metron-alerts/src/environments/environment.ts
@@ -23,5 +23,6 @@
export const environment = {
production: false,
indices: null,
- defaultPollingState: false
+ defaultPollingState: false,
+ noTransition: false
};
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/index.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/index.html b/metron-interface/metron-alerts/src/index.html
index e63e9bd..e051e27 100644
--- a/metron-interface/metron-alerts/src/index.html
+++ b/metron-interface/metron-alerts/src/index.html
@@ -22,7 +22,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="assets/fonts/font.css">
</head>
-<body class="notransition">
+<body class="">
<metron-alerts-root>Loading...</metron-alerts-root>
</body>
</html>
[2/3] metron git commit: METRON-1683 PCAP UI - Fix the download
progress bar (sardell via merrimanr) closes apache/metron#1122
Posted by rm...@apache.org.
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.spec.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.spec.ts b/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.spec.ts
index 155e1f8..de39a0a 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.spec.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.spec.ts
@@ -16,9 +16,10 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { fakePacket } from '../model/pdml.mock';
import { PcapPacketComponent } from './pcap-packet.component';
-import { PdmlPacket } from '../model/pdml';
+import { By } from '@angular/platform-browser';
describe('PcapPacketComponent', () => {
let component: PcapPacketComponent;
@@ -34,1250 +35,45 @@ describe('PcapPacketComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(PcapPacketComponent);
component = fixture.componentInstance;
- component.packet = fakePacket as PdmlPacket;
+ component.packet = fakePacket;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
-});
-const fakePacket = {
- name: "something",
- expanded: false,
- protos: [
- {
- "name": "geninfo",
- "pos": "0",
- "showname": "General information",
- "size": "722",
- "hide": null,
- "fields": [
- {
- "name": "num",
- "pos": "0",
- "showname": "Number",
- "size": "722",
- "value": "1",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "len",
- "pos": "0",
- "showname": "Frame Length",
- "size": "722",
- "value": "2d2",
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "caplen",
- "pos": "0",
- "showname": "Captured Length",
- "size": "722",
- "value": "2d2",
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "timestamp",
- "pos": "0",
- "showname": "Captured Time",
- "size": "722",
- "value": "1458240269.373968000",
- "show": "Mar 17, 2016 18:44:29.373968000 UTC",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "frame",
- "pos": "0",
- "showname": "Frame 1: 722 bytes on wire (5776 bits), 722 bytes captured (5776 bits)",
- "size": "722",
- "hide": null,
- "fields": [
- {
- "name": "frame.dlt",
- "pos": "0",
- "showname": "WTAP_ENCAP: 1",
- "size": "0",
- "value": null,
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time",
- "pos": "0",
- "showname": "Arrival Time: Mar 17, 2016 18:44:29.373968000 UTC",
- "size": "0",
- "value": null,
- "show": "Mar 17, 2016 18:44:29.373968000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.offset_shift",
- "pos": "0",
- "showname": "Time shift for this packet: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_epoch",
- "pos": "0",
- "showname": "Epoch Time: 1458240269.373968000 seconds",
- "size": "0",
- "value": null,
- "show": "1458240269.373968000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_delta",
- "pos": "0",
- "showname": "Time delta from previous captured frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_delta_displayed",
- "pos": "0",
- "showname": "Time delta from previous displayed frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_relative",
- "pos": "0",
- "showname": "Time since reference or first frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.number",
- "pos": "0",
- "showname": "Frame Number: 1",
- "size": "0",
- "value": null,
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.len",
- "pos": "0",
- "showname": "Frame Length: 722 bytes (5776 bits)",
- "size": "0",
- "value": null,
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.cap_len",
- "pos": "0",
- "showname": "Capture Length: 722 bytes (5776 bits)",
- "size": "0",
- "value": null,
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.marked",
- "pos": "0",
- "showname": "Frame is marked: False",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.ignored",
- "pos": "0",
- "showname": "Frame is ignored: False",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.protocols",
- "pos": "0",
- "showname": "Protocols in frame: eth:ip:tcp:ssh",
- "size": "0",
- "value": null,
- "show": "eth:ip:tcp:ssh",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "eth",
- "pos": "0",
- "showname": "Ethernet II, Src: CadmusCo_96:a4:7a (08:00:27:96:a4:7a), Dst: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "14",
- "hide": null,
- "fields": [
- {
- "name": "eth.dst",
- "pos": "0",
- "showname": "Destination: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "6",
- "value": "0a0027000000",
- "show": "0a:00:27:00:00:00",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "eth.addr",
- "pos": "0",
- "showname": "Address: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "6",
- "value": "0a0027000000",
- "show": "0a:00:27:00:00:00",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.lg",
- "pos": "0",
- "showname": ".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)",
- "size": "3",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "0a0027",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.ig",
- "pos": "0",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "0a0027",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "eth.src",
- "pos": "6",
- "showname": "Source: CadmusCo_96:a4:7a (08:00:27:96:a4:7a)",
- "size": "6",
- "value": "08002796a47a",
- "show": "08:00:27:96:a4:7a",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "eth.addr",
- "pos": "6",
- "showname": "Address: CadmusCo_96:a4:7a (08:00:27:96:a4:7a)",
- "size": "6",
- "value": "08002796a47a",
- "show": "08:00:27:96:a4:7a",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.lg",
- "pos": "6",
- "showname": ".... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "080027",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.ig",
- "pos": "6",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "080027",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "eth.type",
- "pos": "12",
- "showname": "Type: IP (0x0800)",
- "size": "2",
- "value": "0800",
- "show": "0x0800",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "ip",
- "pos": "14",
- "showname": "Internet Protocol Version 4, Src: 192.168.66.121 (192.168.66.121), Dst: 192.168.66.1 (192.168.66.1)",
- "size": "20",
- "hide": null,
- "fields": [
- {
- "name": "ip.version",
- "pos": "14",
- "showname": "Version: 4",
- "size": "1",
- "value": "45",
- "show": "4",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.hdr_len",
- "pos": "14",
- "showname": "Header length: 20 bytes",
- "size": "1",
- "value": "45",
- "show": "20",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dsfield",
- "pos": "15",
- "showname": "Differentiated Services Field: 0x10 (DSCP 0x04: Unknown DSCP; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))",
- "size": "1",
- "value": "10",
- "show": "16",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.dsfield.dscp",
- "pos": "15",
- "showname": "0001 00.. = Differentiated Services Codepoint: Unknown (0x04)",
- "size": "1",
- "value": "4",
- "show": "0x04",
- "unmaskedvalue": "10",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dsfield.ecn",
- "pos": "15",
- "showname": ".... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)",
- "size": "1",
- "value": "0",
- "show": "0x00",
- "unmaskedvalue": "10",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.len",
- "pos": "16",
- "showname": "Total Length: 708",
- "size": "2",
- "value": "02c4",
- "show": "708",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.id",
- "pos": "18",
- "showname": "Identification: 0x7cd9 (31961)",
- "size": "2",
- "value": "7cd9",
- "show": "0x7cd9",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags",
- "pos": "20",
- "showname": "Flags: 0x02 (Don't Fragment)",
- "size": "1",
- "value": "40",
- "show": "0x02",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.flags.rb",
- "pos": "20",
- "showname": "0... .... = Reserved bit: Not set",
- "size": "1",
- "value": "40",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags.df",
- "pos": "20",
- "showname": ".1.. .... = Don't fragment: Set",
- "size": "1",
- "value": "40",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags.mf",
- "pos": "20",
- "showname": "..0. .... = More fragments: Not set",
- "size": "1",
- "value": "40",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.frag_offset",
- "pos": "20",
- "showname": "Fragment offset: 0",
- "size": "2",
- "value": "4000",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.ttl",
- "pos": "22",
- "showname": "Time to live: 64",
- "size": "1",
- "value": "40",
- "show": "64",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.proto",
- "pos": "23",
- "showname": "Protocol: TCP (6)",
- "size": "1",
- "value": "06",
- "show": "6",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.checksum",
- "pos": "24",
- "showname": "Header checksum: 0xb57f [correct]",
- "size": "2",
- "value": "b57f",
- "show": "0xb57f",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.checksum_good",
- "pos": "24",
- "showname": "Good: True",
- "size": "2",
- "value": "b57f",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.checksum_bad",
- "pos": "24",
- "showname": "Bad: False",
- "size": "2",
- "value": "b57f",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.src",
- "pos": "26",
- "showname": "Source: 192.168.66.121 (192.168.66.121)",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.addr",
- "pos": "26",
- "showname": "Source or Destination Address: 192.168.66.121 (192.168.66.121)",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.src_host",
- "pos": "26",
- "showname": "Source Host: 192.168.66.121",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.host",
- "pos": "26",
- "showname": "Source or Destination Host: 192.168.66.121",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dst",
- "pos": "30",
- "showname": "Destination: 192.168.66.1 (192.168.66.1)",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.addr",
- "pos": "30",
- "showname": "Source or Destination Address: 192.168.66.1 (192.168.66.1)",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dst_host",
- "pos": "30",
- "showname": "Destination Host: 192.168.66.1",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.host",
- "pos": "30",
- "showname": "Source or Destination Host: 192.168.66.1",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "tcp",
- "pos": "34",
- "showname": "Transmission Control Protocol, Src Port: ssh (22), Dst Port: 55791 (55791), Seq: 1, Ack: 1, Len: 656",
- "size": "32",
- "hide": null,
- "fields": [
- {
- "name": "tcp.srcport",
- "pos": "34",
- "showname": "Source port: ssh (22)",
- "size": "2",
- "value": "0016",
- "show": "22",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.dstport",
- "pos": "36",
- "showname": "Destination port: 55791 (55791)",
- "size": "2",
- "value": "d9ef",
- "show": "55791",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.port",
- "pos": "34",
- "showname": "Source or Destination Port: 22",
- "size": "2",
- "value": "0016",
- "show": "22",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.port",
- "pos": "36",
- "showname": "Source or Destination Port: 55791",
- "size": "2",
- "value": "d9ef",
- "show": "55791",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.stream",
- "pos": "34",
- "showname": "Stream index: 0",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.len",
- "pos": "46",
- "showname": "TCP Segment Len: 656",
- "size": "1",
- "value": "80",
- "show": "656",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.seq",
- "pos": "38",
- "showname": "Sequence number: 1 (relative sequence number)",
- "size": "4",
- "value": "12903044",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.nxtseq",
- "pos": "34",
- "showname": "Next sequence number: 657 (relative sequence number)",
- "size": "0",
- "value": null,
- "show": "657",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.ack",
- "pos": "42",
- "showname": "Acknowledgment number: 1 (relative ack number)",
- "size": "4",
- "value": "8b92f3e7",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.hdr_len",
- "pos": "46",
- "showname": "Header length: 32 bytes",
- "size": "1",
- "value": "80",
- "show": "32",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags",
- "pos": "46",
- "showname": "Flags: 0x018 (PSH, ACK)",
- "size": "2",
- "value": "18",
- "show": "0x0018",
- "unmaskedvalue": "8018",
- "hide": null,
- "fields": [
- {
- "name": "tcp.flags.res",
- "pos": "46",
- "showname": "000. .... .... = Reserved: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "80",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ns",
- "pos": "46",
- "showname": "...0 .... .... = Nonce: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "80",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.cwr",
- "pos": "47",
- "showname": ".... 0... .... = Congestion Window Reduced (CWR): Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ecn",
- "pos": "47",
- "showname": ".... .0.. .... = ECN-Echo: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.urg",
- "pos": "47",
- "showname": ".... ..0. .... = Urgent: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ack",
- "pos": "47",
- "showname": ".... ...1 .... = Acknowledgment: Set",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.push",
- "pos": "47",
- "showname": ".... .... 1... = Push: Set",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.reset",
- "pos": "47",
- "showname": ".... .... .0.. = Reset: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.syn",
- "pos": "47",
- "showname": ".... .... ..0. = Syn: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.fin",
- "pos": "47",
- "showname": ".... .... ...0 = Fin: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.window_size_value",
- "pos": "48",
- "showname": "Window size value: 501",
- "size": "2",
- "value": "01f5",
- "show": "501",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.window_size",
- "pos": "48",
- "showname": "Calculated window size: 501",
- "size": "2",
- "value": "01f5",
- "show": "501",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.window_size_scalefactor",
- "pos": "48",
- "showname": "Window size scaling factor: -1 (unknown)",
- "size": "2",
- "value": "01f5",
- "show": "-1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.checksum",
- "pos": "50",
- "showname": "Checksum: 0x0882 [validation disabled]",
- "size": "2",
- "value": "0882",
- "show": "0x0882",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.checksum_good",
- "pos": "50",
- "showname": "Good Checksum: False",
- "size": "2",
- "value": "0882",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.checksum_bad",
- "pos": "50",
- "showname": "Bad Checksum: False",
- "size": "2",
- "value": "0882",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.options",
- "pos": "54",
- "showname": "Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps",
- "size": "12",
- "value": "0101080a0014f4f811bdb98f",
- "show": "01:01:08:0a:00:14:f4:f8:11:bd:b9:8f",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "",
- "pos": "54",
- "showname": null,
- "size": "1",
- "value": "01",
- "show": "No-Operation (NOP)",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type",
- "pos": "54",
- "showname": "Type: 1",
- "size": "1",
- "value": "01",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type.copy",
- "pos": "54",
- "showname": "0... .... = Copy on fragmentation: No",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.class",
- "pos": "54",
- "showname": ".00. .... = Class: Control (0)",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.number",
- "pos": "54",
- "showname": "...0 0001 = Number: No-Operation (NOP) (1)",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "",
- "pos": "55",
- "showname": null,
- "size": "1",
- "value": "01",
- "show": "No-Operation (NOP)",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type",
- "pos": "55",
- "showname": "Type: 1",
- "size": "1",
- "value": "01",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type.copy",
- "pos": "55",
- "showname": "0... .... = Copy on fragmentation: No",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.class",
- "pos": "55",
- "showname": ".00. .... = Class: Control (0)",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.number",
- "pos": "55",
- "showname": "...0 0001 = Number: No-Operation (NOP) (1)",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "",
- "pos": "56",
- "showname": null,
- "size": "10",
- "value": "080a0014f4f811bdb98f",
- "show": "Timestamps: TSval 1373432, TSecr 297646479",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.option_kind",
- "pos": "56",
- "showname": "Kind: Timestamp (8)",
- "size": "1",
- "value": "08",
- "show": "8",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.option_len",
- "pos": "57",
- "showname": "Length: 10",
- "size": "1",
- "value": "0a",
- "show": "10",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.options.timestamp.tsval",
- "pos": "58",
- "showname": "Timestamp value: 1373432",
- "size": "4",
- "value": "0014f4f8",
- "show": "1373432",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.options.timestamp.tsecr",
- "pos": "62",
- "showname": "Timestamp echo reply: 297646479",
- "size": "4",
- "value": "11bdb98f",
- "show": "297646479",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.analysis",
- "pos": "34",
- "showname": "SEQ/ACK analysis",
- "size": "0",
- "value": "",
- "show": "",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.analysis.bytes_in_flight",
- "pos": "34",
- "showname": "Bytes in flight: 656",
- "size": "0",
- "value": null,
- "show": "656",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ]
- },
- {
- "name": "ssh",
- "pos": "66",
- "showname": "SSH Protocol",
- "size": "656",
- "hide": null,
- "fields": [
- {
- "name": "ssh.encrypted_packet",
- "pos": "66",
- "showname": "Encrypted Packet: 5b2bfe1fa006867834412184af9f5b239737763adead7140...",
- "size": "656",
- "value": "5b2bfe1fa006867834412184af9f5b239737763adead71408fc01b88e548b2cc86f341a39771c6ed16f2b0bb3e6ab6109e73c7d68ca7545852f91930e4633c17fb9dc7aa794b0d820d0fa3ac65bf0f013e5449d5953d2943506657e2b76b548e67f5c9ce1a4c53db1b52465bde7208baf11f3fe01975418b4db186a38ad32947d1908b62e532da4b729353a932423d25f5f734484076aa4143c6a74937a4ea49448e261ae1ecb6b07bbdf5c98d0855940a19018c88263b8936f7b3e9a4b6cd98090fa10a10e37ad20fe5d833071ad6d5b2886ba85ec72affb83e316443dbe29dbf643e6aa05595c90765cf85f6da55cc1c09d8dccc7d05da022429ad602a559a044b7e2663b0c153a3011bf824ef8d1fa56cba957c5f5d2276a1c9e92de65782f406848c6e20f634c5d1fea843a8bf1a4058e85553f5838f7299958fbf54be84e46c5a3c3965f8bed7fe03a9a1168a892e0073adeb54deca171a318d11fc1a8179f91632310213da327965a40bc6fe18eae55e8da6b57d7ef9f3a05b42381bcb3db8f8efd6d0c638a2cdd46efb0b8f1274e98672f644b2275947e626b02e5166f86c2dd4a67b81e213f8c064927a396815db589f10e5e521ffedb13f8edbe2de01c6fc8bf0e12c82212e497794aa045e9b6fcca83b4cad0a3b5e6ca2d1feaf8887b4d64f22989396e
cfa8f7f1835eed422580505109fed36797bdc10a9168d5148daef6a8710c3df1d6366c9763ab4ebd359d86a8ea14819252fb52ba423422d1f60b0179316b3729e479ba07e88cb886938c8daae65d470dde91e5336e0fc4221a72cc49057d878aa5924875d097483e94bc44a4ea93aee8780e56c50a405932841f50da156e1f90559a7c4f76999442fb433a26fc703dea656bbe03790ac3c9c5318ff5f81d87d483524bbfe7ff167",
- "show": "5b:2b:fe:1f:a0:06:86:78:34:41:21:84:af:9f:5b:23:97:37:76:3a:de:ad:71:40:8f:c0:1b:88:e5:48:b2:cc:86:f3:41:a3:97:71:c6:ed:16:f2:b0:bb:3e:6a:b6:10:9e:73:c7:d6:8c:a7:54:58:52:f9:19:30:e4:63:3c:17:fb:9d:c7:aa:79:4b:0d:82:0d:0f:a3:ac:65:bf:0f:01:3e:54:49:d5:95:3d:29:43:50:66:57:e2:b7:6b:54:8e:67:f5:c9:ce:1a:4c:53:db:1b:52:46:5b:de:72:08:ba:f1:1f:3f:e0:19:75:41:8b:4d:b1:86:a3:8a:d3:29:47:d1:90:8b:62:e5:32:da:4b:72:93:53:a9:32:42:3d:25:f5:f7:34:48:40:76:aa:41:43:c6:a7:49:37:a4:ea:49:44:8e:26:1a:e1:ec:b6:b0:7b:bd:f5:c9:8d:08:55:94:0a:19:01:8c:88:26:3b:89:36:f7:b3:e9:a4:b6:cd:98:09:0f:a1:0a:10:e3:7a:d2:0f:e5:d8:33:07:1a:d6:d5:b2:88:6b:a8:5e:c7:2a:ff:b8:3e:31:64:43:db:e2:9d:bf:64:3e:6a:a0:55:95:c9:07:65:cf:85:f6:da:55:cc:1c:09:d8:dc:cc:7d:05:da:02:24:29:ad:60:2a:55:9a:04:4b:7e:26:63:b0:c1:53:a3:01:1b:f8:24:ef:8d:1f:a5:6c:ba:95:7c:5f:5d:22:76:a1:c9:e9:2d:e6:57:82:f4:06:84:8c:6e:20:f6:34:c5:d1:fe:a8:43:a8:bf:1a:40:58:e8:55:53:f5:83:8f:72:99:95:8f:bf:54:be:84:e4:6c:5a:3c:39:65:
f8:be:d7:fe:03:a9:a1:16:8a:89:2e:00:73:ad:eb:54:de:ca:17:1a:31:8d:11:fc:1a:81:79:f9:16:32:31:02:13:da:32:79:65:a4:0b:c6:fe:18:ea:e5:5e:8d:a6:b5:7d:7e:f9:f3:a0:5b:42:38:1b:cb:3d:b8:f8:ef:d6:d0:c6:38:a2:cd:d4:6e:fb:0b:8f:12:74:e9:86:72:f6:44:b2:27:59:47:e6:26:b0:2e:51:66:f8:6c:2d:d4:a6:7b:81:e2:13:f8:c0:64:92:7a:39:68:15:db:58:9f:10:e5:e5:21:ff:ed:b1:3f:8e:db:e2:de:01:c6:fc:8b:f0:e1:2c:82:21:2e:49:77:94:aa:04:5e:9b:6f:cc:a8:3b:4c:ad:0a:3b:5e:6c:a2:d1:fe:af:88:87:b4:d6:4f:22:98:93:96:ec:fa:8f:7f:18:35:ee:d4:22:58:05:05:10:9f:ed:36:79:7b:dc:10:a9:16:8d:51:48:da:ef:6a:87:10:c3:df:1d:63:66:c9:76:3a:b4:eb:d3:59:d8:6a:8e:a1:48:19:25:2f:b5:2b:a4:23:42:2d:1f:60:b0:17:93:16:b3:72:9e:47:9b:a0:7e:88:cb:88:69:38:c8:da:ae:65:d4:70:dd:e9:1e:53:36:e0:fc:42:21:a7:2c:c4:90:57:d8:78:aa:59:24:87:5d:09:74:83:e9:4b:c4:4a:4e:a9:3a:ee:87:80:e5:6c:50:a4:05:93:28:41:f5:0d:a1:56:e1:f9:05:59:a7:c4:f7:69:99:44:2f:b4:33:a2:6f:c7:03:de:a6:56:bb:e0:37:90:ac:3c:9c:53:18:ff:5f:81:d8:7d:48:35:24:bb:fe:7f:f1:67",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- }
- ]
-};
+ it('should expand the packet`s proto fieldset', () => {
+
+ const protos = fixture.debugElement.queryAll(By.css('[data-qe-id="proto"]'));
+
+ protos.forEach((proto, i) => {
+
+ expect(proto.query(By.css('[data-qe-id="proto-fields"]'))).toBeFalsy();
+ proto.nativeElement.click();
+ fixture.detectChanges();
+ const fieldsContainer = proto.query(By.css('[data-qe-id="proto-fields"]'));
+ expect(fieldsContainer).toBeDefined();
+
+ const fields = fieldsContainer.queryAll(By.css('[data-qe-id="proto-field"]'));
+
+ fields.forEach((field, j) => {
+ const name = field.query(By.css('[data-qe-id="proto-field-name"]'));
+ expect(name.nativeElement.textContent.trim()).toBe(fakePacket.protos[i].fields[j].name);
+ const showname = field.query(By.css('[data-qe-id="proto-field-showname"]'));
+ expect(showname.nativeElement.textContent.trim()).toBe(fakePacket.protos[i].fields[j].showname);
+ });
+ });
+ });
+
+ it('should render proto`s showname property', () => {
+ const protos = fixture.debugElement.queryAll(By.css('[data-qe-id="proto"]'));
+ protos.forEach((proto, i) => {
+ expect(
+ proto.query(By.css('[data-qe-id="proto-showname"]'))
+ .nativeElement
+ .textContent.trim()
+ ).toBe(fakePacket.protos[i].showname);
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html
index 12d8df0..950f49c 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html
@@ -16,13 +16,13 @@
<app-pcap-filters [queryRunning]="queryRunning" (search)="onSearch($event)"></app-pcap-filters>
</div>
<div *ngIf="queryRunning" class="progress pcap-progress-background">
- <div class="progress-bar progress-bar-animated pcap-progress" role="progressbar" attr.aria-valuenow="{{progressWidth}}" aria-valuemin="0" aria-valuemax="100" [ngStyle]="{'max-width': progressWidth + '%', 'transition-duration':'1000ms'}">{{progressWidth}}%</div>
+ <div class="progress-bar progress-bar-animated pcap-progress" role="progressbar" attr.aria-valuenow="{{progressWidth}}" aria-valuemin="0" aria-valuemax="100" [ngStyle]="{'width': progressWidth + '%'}">{{progressWidth}}%</div>
</div>
- <div *ngIf="errorMsg" class="alert alert-danger" role="alert">
+ <div *ngIf="errorMsg" class="alert alert-danger" role="alert" data-qe-id="error">
{{ errorMsg }}
</div>
<div class="panel-body" *ngIf="pdml">
<app-pcap-list [packets]="pdml.packets" [pagination]="pagination" (pageUpdate)="changePage($event)"></app-pcap-list>
</div>
- <a class="btn btn-primary" [attr.href]="getDownloadUrl()" *ngIf="pdml">Download PCAP</a>
+ <a class="btn btn-primary" [attr.href]="getDownloadUrl()" *ngIf="pdml" data-qe-id="download-link">Download PCAP</a>
</div>
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.scss
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.scss b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.scss
index a8cc2ce..8989bf9 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.scss
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.scss
@@ -31,22 +31,4 @@
.progress-bar {
width: 0;
- animation: progress 1.5s ease-in-out forwards;
}
-
-@keyframes progress {
- from {
- width: 0;
- }
- to {
- width: 100%;
- }
-}
-@keyframes show {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts
index 6eb375e..bd732ad 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts
@@ -15,13 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { PcapPanelComponent } from './pcap-panel.component';
import { Component, Input } from '../../../../node_modules/@angular/core';
-import { PdmlPacket } from '../model/pdml';
+import { PdmlPacket, Pdml } from '../model/pdml';
import { PcapService } from '../service/pcap.service';
+import { PcapStatusResponse } from '../model/pcap-status-response';
import { PcapPagination } from '../model/pcap-pagination';
+import { By } from '../../../../node_modules/@angular/platform-browser';
+import { PcapRequest } from '../model/pcap.request';
+import { defer } from 'rxjs/observable/defer';
@Component({
selector: 'app-pcap-filters',
@@ -40,9 +44,17 @@ class FakePcapListComponent {
@Input() pagination: PcapPagination;
}
+class FakePcapService {
+ getDownloadUrl() {
+ return '';
+ }
+ submitRequest() {}
+}
+
describe('PcapPanelComponent', () => {
let component: PcapPanelComponent;
let fixture: ComponentFixture<PcapPanelComponent>;
+ let pcapService: PcapService;
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -52,13 +64,14 @@ describe('PcapPanelComponent', () => {
PcapPanelComponent,
],
providers: [
- { provide: PcapService, useValue: {} },
+ { provide: PcapService, useClass: FakePcapService },
]
})
.compileComponents();
}));
beforeEach(() => {
+ pcapService = TestBed.get(PcapService);
fixture = TestBed.createComponent(PcapPanelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
@@ -67,4 +80,247 @@ describe('PcapPanelComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('should hold filter bar', () => {
+ expect(fixture.debugElement.query(By.css('app-pcap-filters'))).toBeDefined();
+ });
+
+ it('should pass queryRunning to filter bar', () => {
+ const myBoolean = new Boolean(true);
+ component.queryRunning = myBoolean as boolean;
+ fixture.detectChanges();
+ const filterBar = fixture.debugElement.query(By.css('app-pcap-filters'));
+ expect(filterBar.componentInstance.queryRunning).toBe(myBoolean);
+ });
+
+ it('should show download link if page/pdml availabe', () => {
+ component.pdml = new Pdml();
+ fixture.detectChanges();
+ const submitButton = fixture.debugElement.query(By.css('[data-qe-id="download-link"]'));
+ expect(submitButton).toBeTruthy();
+ });
+
+ it('should hide download link if page/pdml not availabe', () => {
+ component.pdml = null;
+ fixture.detectChanges();
+ const submitButton = fixture.debugElement.query(By.css('[data-qe-id="download-link"]'));
+ expect(submitButton).toBeFalsy();
+ });
+
+ it('should show the progress bar if the query is running', () => {
+ expect(fixture.debugElement.query(By.css('.pcap-progress'))).toBeFalsy();
+ component.progressWidth = 42;
+ component.queryRunning = true;
+ fixture.detectChanges();
+ const progress = fixture.debugElement.query(By.css('.pcap-progress'));
+ expect(progress).toBeTruthy();
+ expect(progress.nativeElement.textContent).toBe(component.progressWidth + '%');
+ expect(progress.attributes['aria-valuenow']).toBe(String(component.progressWidth));
+ expect(progress.styles.width).toBe(component.progressWidth + '%');
+ });
+
+ it('should render the given error message', () => {
+ expect(fixture.debugElement.query(By.css('[data-qe-id="error"]'))).toBeFalsy();
+ component.errorMsg = 'something went wrong!';
+ fixture.detectChanges();
+ expect(fixture.debugElement.query(By.css('[data-qe-id="error"]')).nativeElement.textContent.trim()).toBe(component.errorMsg);
+ });
+
+ it('should hide the progress bar if the query is not running', () => {
+ expect(fixture.debugElement.query(By.css('.pcap-progress'))).toBeFalsy();
+ component.queryRunning = false;
+ fixture.detectChanges();
+ expect(fixture.debugElement.query(By.css('.pcap-progress'))).toBeFalsy();
+ });
+
+ it('should render the pcap list and the download link if a valid pdml is provided', fakeAsync(() => {
+
+ const page = 42;
+ const myPdml = new Pdml();
+ myPdml.packets = [];
+
+ pcapService.getPackets = jasmine.createSpy('getPackets').and.returnValue(
+ defer(() => Promise.resolve(myPdml))
+ );
+
+ component.pdml = null;
+ fixture.detectChanges();
+
+ component.changePage(page);
+
+ expect(fixture.debugElement.query(By.css('app-pcap-list'))).toBeFalsy();
+ expect(fixture.debugElement.query(By.css('[data-qe-id="download-link"]'))).toBeFalsy();
+
+ tick();
+ fixture.detectChanges();
+
+ const pcapList = fixture.debugElement.query(By.css('app-pcap-list'));
+
+ expect(pcapList).toBeTruthy();
+ expect((pcapList.componentInstance.pagination as PcapPagination).selectedPage).toBe(page, 'it should pass the selected page number');
+ expect(pcapList.componentInstance.packets).toBe(myPdml.packets, 'it should pass the packets from the given pdml');
+ expect(fixture.debugElement.query(By.css('[data-qe-id="download-link"]'))).toBeTruthy();
+ }));
+
+ it('should not render the pcap list and the download link if there is no pdml', fakeAsync(() => {
+
+ pcapService.getPackets = jasmine.createSpy('getPackets').and.returnValue(
+ defer(() => Promise.resolve(null))
+ );
+
+ component.pdml = null;
+ fixture.detectChanges();
+
+ component.changePage(42);
+
+ expect(fixture.debugElement.query(By.css('app-pcap-list'))).toBeFalsy();
+ expect(fixture.debugElement.query(By.css('[data-qe-id="download-link"]'))).toBeFalsy();
+
+ tick();
+ fixture.detectChanges();
+
+ expect(fixture.debugElement.query(By.css('app-pcap-list'))).toBeFalsy();
+ expect(fixture.debugElement.query(By.css('[data-qe-id="download-link"]'))).toBeFalsy();
+ }));
+
+ it('should render the error message if the search response has no valid job id', fakeAsync(() => {
+ const response = new PcapStatusResponse();
+ response.jobId = '';
+ response.description = 'error message';
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.resolve(response))
+ );
+
+ component.onSearch(new PcapRequest());
+
+ tick();
+ fixture.detectChanges();
+
+ expect(
+ fixture.debugElement.query(By.css('[data-qe-id="error"]'))
+ .nativeElement
+ .textContent.trim()
+ ).toBe(response.description);
+ }));
+
+ it('should render the error message if the search request fails', fakeAsync(() => {
+
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.reject(new Error('search error')))
+ );
+
+ component.onSearch(new PcapRequest());
+
+ tick();
+ fixture.detectChanges();
+
+ expect(
+ fixture.debugElement.query(By.css('[data-qe-id="error"]'))
+ .nativeElement
+ .textContent.trim()
+ ).toBe('Response message: search error. Something went wrong with your query submission!');
+ }));
+
+ it('should render the error message if the poll status request fails', fakeAsync(() => {
+
+ const response = new PcapStatusResponse();
+ response.jobId = '42';
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.resolve(response))
+ );
+
+ pcapService.pollStatus = jasmine.createSpy('pollStatus').and.returnValue(
+ defer(() => Promise.reject(new Error('poll error')))
+ );
+
+ component.onSearch(new PcapRequest());
+
+ tick();
+ fixture.detectChanges();
+
+ expect(
+ fixture.debugElement.query(By.css('[data-qe-id="error"]'))
+ .nativeElement
+ .textContent.trim()
+ ).toBe('Response message: poll error. Something went wrong with your status request!');
+ }));
+
+ it('should render the error message if the poll response`s job status is "failed"', fakeAsync(() => {
+ const searchResponse = new PcapStatusResponse();
+ searchResponse.jobId = '42';
+
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.resolve(searchResponse))
+ );
+
+ const pollResponse = new PcapStatusResponse();
+ pollResponse.jobStatus = 'FAILED';
+ pcapService.pollStatus = jasmine.createSpy('pollStatus').and.returnValue(
+ defer(() => Promise.resolve(pollResponse))
+ );
+
+ component.onSearch(new PcapRequest());
+
+ tick();
+ fixture.detectChanges();
+
+ expect(
+ fixture.debugElement.query(By.css('[data-qe-id="error"]'))
+ .nativeElement
+ .textContent.trim()
+ ).toBe(`Query status: ${pollResponse.jobStatus}. Check your filter criteria and try again!`);
+ }));
+
+ it('should render the progress if the poll status is neither "succeded" nor "failed"', fakeAsync(() => {
+ const searchResponse = new PcapStatusResponse();
+ searchResponse.jobId = '42';
+
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.resolve(searchResponse))
+ );
+
+ const pollResponse = new PcapStatusResponse();
+ pollResponse.percentComplete = 86;
+ pcapService.pollStatus = jasmine.createSpy('pollStatus').and.returnValue(
+ defer(() => Promise.resolve(pollResponse))
+ );
+
+ component.progressWidth = 98;
+
+ component.onSearch(new PcapRequest());
+
+ tick();
+ fixture.detectChanges();
+
+ const progress = fixture.debugElement.query(By.css('.pcap-progress'));
+ expect(progress.nativeElement.textContent).toBe(pollResponse.percentComplete + '%');
+ }));
+
+ it('should render the pcap list if the poll status is "succeeded"', fakeAsync(() => {
+ const searchResponse = new PcapStatusResponse();
+ searchResponse.jobId = '42';
+
+ pcapService.submitRequest = jasmine.createSpy('submitRequest').and.returnValue(
+ defer(() => Promise.resolve(searchResponse))
+ );
+
+ const pollResponse = new PcapStatusResponse();
+ pcapService.pollStatus = jasmine.createSpy('pollStatus').and.returnValue(
+ defer(() => Promise.resolve(pollResponse))
+ );
+
+ const myPdml = new Pdml();
+ pcapService.getPackets = jasmine.createSpy('getPackets').and.returnValue(
+ defer(() => Promise.resolve(myPdml))
+ );
+
+ component.onSearch(new PcapRequest());
+
+ expect(fixture.debugElement.query(By.css('app-pcap-list'))).toBeFalsy();
+
+ tick();
+ fixture.detectChanges();
+
+ expect(fixture.debugElement.query(By.css('app-pcap-list'))).toBeDefined();
+ }));
});
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts
index 8e7f2f1..82121d4 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts
@@ -53,34 +53,44 @@ export class PcapPanelComponent {
}
onSearch(pcapRequest) {
+ this.queryRunning = true;
this.savedPcapRequest = pcapRequest;
this.pagination.selectedPage = 1;
this.pdml = null;
this.progressWidth = 0;
+ this.errorMsg = null;
this.pcapService.submitRequest(pcapRequest).subscribe((submitResponse: PcapStatusResponse) => {
- this.queryId = submitResponse.jobId;
- this.queryRunning = true;
- this.errorMsg = null;
- this.statusSubscription = this.pcapService.pollStatus(submitResponse.jobId).subscribe((statusResponse: PcapStatusResponse) => {
- if ('SUCCEEDED' === statusResponse.jobStatus) {
- this.pagination.total = statusResponse.pageTotal;
- this.statusSubscription.unsubscribe();
- this.queryRunning = false;
- this.pcapService.getPackets(submitResponse.jobId, this.pagination.selectedPage).toPromise().then(pdml => {
- this.pdml = pdml;
- });
- } else if ('FAILED' === statusResponse.jobStatus) {
+ let id = submitResponse.jobId;
+ if (!id) {
+ this.errorMsg = submitResponse.description;
+ this.queryRunning = false;
+ } else {
+ this.queryId = id;
+ this.errorMsg = null;
+ this.statusSubscription = this.pcapService.pollStatus(id).subscribe((statusResponse: PcapStatusResponse) => {
+ if ('SUCCEEDED' === statusResponse.jobStatus) {
+ this.pagination.total = statusResponse.pageTotal;
+ this.statusSubscription.unsubscribe();
+ this.queryRunning = false;
+ this.pcapService.getPackets(submitResponse.jobId, this.pagination.selectedPage).toPromise().then(pdml => {
+ this.pdml = pdml;
+ });
+ } else if ('FAILED' === statusResponse.jobStatus) {
+ this.statusSubscription.unsubscribe();
+ this.queryRunning = false;
+ this.errorMsg = `Query status: ${statusResponse.jobStatus}. Check your filter criteria and try again!`;
+ } else if (this.progressWidth < 100) {
+ this.progressWidth = Math.trunc(statusResponse.percentComplete);
+ }
+ }, (error: any) => {
this.statusSubscription.unsubscribe();
this.queryRunning = false;
- this.errorMsg = `Query status: ${statusResponse.jobStatus}. Check your filter criteria and try again!`;
- } else if (this.progressWidth < 100) {
- this.progressWidth = Math.trunc(statusResponse.percentComplete);
- }
- }, (error: any) => {
- this.statusSubscription.unsubscribe();
- this.queryRunning = false;
- this.errorMsg = `Response status: ${error.responseCode}. Something went wrong with your status request!`;
- });
+ this.errorMsg = `Response message: ${error.message}. Something went wrong with your status request!`;
+ });
+ }
+ }, (error: any) => {
+ this.queryRunning = false;
+ this.errorMsg = `Response message: ${error.message}. Something went wrong with your query submission!`;
});
}
[3/3] metron git commit: METRON-1683 PCAP UI - Fix the download
progress bar (sardell via merrimanr) closes apache/metron#1122
Posted by rm...@apache.org.
METRON-1683 PCAP UI - Fix the download progress bar (sardell via merrimanr) closes apache/metron#1122
Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/3e778592
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/3e778592
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/3e778592
Branch: refs/heads/feature/METRON-1554-pcap-query-panel
Commit: 3e7785920e8f0c5aadf36e05dbcfa69252cc5574
Parents: 037b50b
Author: sardell <sa...@hortonworks.com>
Authored: Tue Aug 7 13:58:08 2018 -0500
Committer: rmerriman <me...@gmail.com>
Committed: Tue Aug 7 13:58:08 2018 -0500
----------------------------------------------------------------------
.../metron-alerts/src/app/app.component.html | 2 +-
.../metron-alerts/src/app/app.component.ts | 3 +
.../src/app/pcap/model/pcap-status-response.ts | 1 +
.../src/app/pcap/model/pcap.mock.ts | 39 +
.../src/app/pcap/model/pdml.mock.ts | 62 +
.../metron-alerts/src/app/pcap/model/pdml.ts | 6 +-
.../app/pcap/pcap-list/pcap-list.component.html | 2 +-
.../pcap/pcap-list/pcap-list.component.spec.ts | 17 +
.../pcap-packet-line.component.spec.ts | 1336 +------------
.../pcap/pcap-packet/pcap-packet.component.html | 11 +-
.../pcap-packet/pcap-packet.component.spec.ts | 1278 +------------
.../pcap/pcap-panel/pcap-panel.component.html | 6 +-
.../pcap/pcap-panel/pcap-panel.component.scss | 18 -
.../pcap-panel/pcap-panel.component.spec.ts | 262 ++-
.../app/pcap/pcap-panel/pcap-panel.component.ts | 52 +-
.../src/app/pcap/service/pcap.service.spec.ts | 1809 +-----------------
.../src/app/pcap/service/pcap.service.ts | 7 +-
.../src/environments/environment.e2e.ts | 3 +-
.../src/environments/environment.prod.ts | 3 +-
.../src/environments/environment.ts | 3 +-
metron-interface/metron-alerts/src/index.html | 2 +-
21 files changed, 674 insertions(+), 4248 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/app.component.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/app.component.html b/metron-interface/metron-alerts/src/app/app.component.html
index 1b992ca..c3a5d3c 100644
--- a/metron-interface/metron-alerts/src/app/app.component.html
+++ b/metron-interface/metron-alerts/src/app/app.component.html
@@ -11,7 +11,7 @@
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.
-->
-<div class="container-fluid px-0">
+<div class="container-fluid px-0" [class.notransition]="noTransition">
<nav class="navbar" *ngIf="loggedIn">
<a class="" href="#">
<img alt="" src="../assets/images/logo.png" width="135" height="45">
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/app.component.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/app.component.ts b/metron-interface/metron-alerts/src/app/app.component.ts
index 2a3c15e..52dee23 100644
--- a/metron-interface/metron-alerts/src/app/app.component.ts
+++ b/metron-interface/metron-alerts/src/app/app.component.ts
@@ -17,6 +17,7 @@
*/
import { Component, OnInit } from '@angular/core';
import {AuthenticationService} from './service/authentication.service';
+import { environment } from 'environments/environment';
declare var $;
@@ -27,11 +28,13 @@ declare var $;
})
export class AppComponent implements OnInit {
loggedIn = false;
+ noTransition = false;
constructor(private authService: AuthenticationService) {
this.authService.onLoginEvent.subscribe(result => {
this.loggedIn = result;
});
+ this.noTransition = environment.noTransition;
}
ngOnInit(): void {
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts b/metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts
index d4d9a5e..09c4985 100644
--- a/metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts
@@ -18,6 +18,7 @@
export class PcapStatusResponse {
jobId: string;
jobStatus: string;
+ description: string;
percentComplete: number;
pageTotal: number;
}
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/model/pcap.mock.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/model/pcap.mock.ts b/metron-interface/metron-alerts/src/app/pcap/model/pcap.mock.ts
new file mode 100644
index 0000000..c867fe9
--- /dev/null
+++ b/metron-interface/metron-alerts/src/app/pcap/model/pcap.mock.ts
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing software
+ * distributed under the License is distributed on an "AS IS" BASIS
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { PcapRequest } from './pcap.request';
+import { PcapStatusResponse } from '../model/pcap-status-response';
+
+export const fakePcapRequest = {
+ startTimeMs: 0,
+ endTimeMs: 0,
+ ipSrcAddr: '0.0.0.0',
+ ipSrcPort: '80',
+ ipDstAddr: '0.0.0.0',
+ ipDstPort: '80',
+ protocol: '*',
+ packetFilter: '*',
+ includeReverse: false
+} as PcapRequest;
+
+export const fakePcapStatusResponse = {
+ jobId: 'job_1234567890123_4567',
+ jobStatus: 'SUBMITTED',
+ description: 'Job submitted.',
+ percentComplete: 0.0,
+ pageTotal: 0
+} as PcapStatusResponse;
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/model/pdml.mock.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/model/pdml.mock.ts b/metron-interface/metron-alerts/src/app/pcap/model/pdml.mock.ts
new file mode 100644
index 0000000..6316b92
--- /dev/null
+++ b/metron-interface/metron-alerts/src/app/pcap/model/pdml.mock.ts
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing software
+ * distributed under the License is distributed on an "AS IS" BASIS
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { PdmlPacket, PdmlProto, PdmlField } from './pdml';
+
+export const fakePdml = {
+ "pdml": {
+ "$": {
+ "version": "0",
+ "creator": "wireshark/2.4.2",
+ "time": "Tue Mar 27 21:55:25 2018",
+ "capture_file": "./metron-platform/metron-api/src/test/resources/test-tcp-packet.pcap"
+ },
+ "packet": [] as PdmlPacket[]
+ }
+};
+
+export const fakePacket = {
+ "name": '',
+ "expanded": false,
+ "protos": [
+ {
+ "name": "geninfo",
+ "showname": "",
+ "fields": [
+ { "name": "timestamp", "pos": "0", "showname": "Captured Time", "size": "722", "value": "1458240269.373968000", "show": "Mar 17, 2016 18:44:29.373968000 UTC", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField
+ ]
+ } as PdmlProto,
+ {
+ "name": "ip",
+ "showname": "",
+ "fields": [
+ { "name": "ip.proto", "pos": "23", "showname": "Protocol: TCP (6)", "size": "1", "value": "06", "show": "6", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField,
+ { "name": "ip.src", "pos": "26", "showname": "Source: 192.168.66.121 (192.168.66.121)", "size": "4", "value": "c0a84279", "show": "192.168.66.121", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField,
+ { "name": "ip.dst", "pos": "30", "showname": "Destination: 192.168.66.1 (192.168.66.1)", "size": "4", "value": "c0a84201", "show": "192.168.66.1", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField
+ ]
+ } as PdmlProto,
+ {
+ "name": "tcp",
+ "showname": "",
+ "fields": [
+ { "name": "tcp.srcport", "pos": "34", "showname": "Source port: ssh (22)", "size": "2", "value": "0016", "show": "22", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField,
+ { "name": "tcp.dstport", "pos": "36", "showname": "Destination port: 55791 (55791)", "size": "2", "value": "d9ef", "show": "55791", "unmaskedvalue": null, "hide": null, "fields": null, "protos": null } as PdmlField
+ ],
+ } as PdmlProto
+ ]
+} as PdmlPacket;
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/model/pdml.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/model/pdml.ts b/metron-interface/metron-alerts/src/app/pcap/model/pdml.ts
index 34245c6..d6b3b40 100644
--- a/metron-interface/metron-alerts/src/app/pcap/model/pdml.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/model/pdml.ts
@@ -30,7 +30,11 @@ export class PdmlProto {
public fields: PdmlField[]
public static findField(p: PdmlProto, name: string): PdmlField {
- return p.fields.find(f => f['name'] == name)
+ if (p && p.fields) {
+ return p.fields.find(f => f['name'] == name)
+ } else {
+ return new PdmlField();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.html b/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.html
index 4d74541..5337935 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.html
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.html
@@ -25,7 +25,7 @@
</thead>
<tbody>
<ng-container *ngFor="let packet of packets">
- <tr (click)="toggle(packet)" app-pcap-packet-line [packet]="packet"></tr>
+ <tr (click)="toggle(packet)" app-pcap-packet-line [packet]="packet" data-qe-id="pcap-packet-line"></tr>
<tr *ngIf="packet.expanded">
<td colspan="6" class="pcap-packet">
<app-pcap-packet [packet]="packet"></app-pcap-packet>
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.spec.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.spec.ts b/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.spec.ts
index 1d0b996..b1e9611 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.spec.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-list/pcap-list.component.spec.ts
@@ -16,6 +16,7 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
import { PcapListComponent } from './pcap-list.component';
import { PcapPagination } from '../model/pcap-pagination';
@@ -64,6 +65,7 @@ describe('PcapListComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(PcapListComponent);
component = fixture.componentInstance;
+ component.packets = [{name: 'test', protos: [], expanded: true}];
component.pagination = new PcapPagination();
component.pagination.total = 10;
fixture.detectChanges();
@@ -78,4 +80,19 @@ describe('PcapListComponent', () => {
component.onPageChange();
expect(incrementSpy).toHaveBeenCalled();
});
+
+ it('should toggle packet details expansion with toggle()', () => {
+ let packet = new PdmlPacket();
+ component.toggle(packet);
+ expect(packet.expanded).toBe(true);
+ component.toggle(packet);
+ expect(packet.expanded).toBe(false);
+ });
+
+ it('should execute toggle() when app-pcap-packet-line is clicked', () => {
+ const packetLineDe = fixture.debugElement.query(By.css('[data-qe-id="pcap-packet-line"]'));
+ const incrementSpy = spyOn(component, 'toggle');
+ packetLineDe.triggerEventHandler('click', null);
+ expect(incrementSpy).toHaveBeenCalled();
+ });
});
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-packet-line/pcap-packet-line.component.spec.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-packet-line/pcap-packet-line.component.spec.ts b/metron-interface/metron-alerts/src/app/pcap/pcap-packet-line/pcap-packet-line.component.spec.ts
index e01f9c6..d01c0cb 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-packet-line/pcap-packet-line.component.spec.ts
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-packet-line/pcap-packet-line.component.spec.ts
@@ -16,9 +16,9 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { fakePacket } from '../model/pdml.mock';
import { PcapPacketLineComponent } from './pcap-packet-line.component';
-import { PdmlPacket } from '../model/pdml';
describe('PcapPacketLineComponent', () => {
let component: PcapPacketLineComponent;
@@ -34,1250 +34,102 @@ describe('PcapPacketLineComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(PcapPacketLineComponent);
component = fixture.componentInstance;
- component.packet = fakePacket as PdmlPacket;
+ component.packet = fakePacket;
fixture.detectChanges();
});
- it('should create', () => {
+ it('should be created', () => {
expect(component).toBeTruthy();
});
-});
-const fakePacket = {
- name: "something",
- expanded: false,
- protos: [
- {
- "name": "geninfo",
- "pos": "0",
- "showname": "General information",
- "size": "722",
- "hide": null,
- "fields": [
- {
- "name": "num",
- "pos": "0",
- "showname": "Number",
- "size": "722",
- "value": "1",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "len",
- "pos": "0",
- "showname": "Frame Length",
- "size": "722",
- "value": "2d2",
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "caplen",
- "pos": "0",
- "showname": "Captured Length",
- "size": "722",
- "value": "2d2",
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "timestamp",
- "pos": "0",
- "showname": "Captured Time",
- "size": "722",
- "value": "1458240269.373968000",
- "show": "Mar 17, 2016 18:44:29.373968000 UTC",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "frame",
- "pos": "0",
- "showname": "Frame 1: 722 bytes on wire (5776 bits), 722 bytes captured (5776 bits)",
- "size": "722",
- "hide": null,
- "fields": [
- {
- "name": "frame.dlt",
- "pos": "0",
- "showname": "WTAP_ENCAP: 1",
- "size": "0",
- "value": null,
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time",
- "pos": "0",
- "showname": "Arrival Time: Mar 17, 2016 18:44:29.373968000 UTC",
- "size": "0",
- "value": null,
- "show": "Mar 17, 2016 18:44:29.373968000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.offset_shift",
- "pos": "0",
- "showname": "Time shift for this packet: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_epoch",
- "pos": "0",
- "showname": "Epoch Time: 1458240269.373968000 seconds",
- "size": "0",
- "value": null,
- "show": "1458240269.373968000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_delta",
- "pos": "0",
- "showname": "Time delta from previous captured frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_delta_displayed",
- "pos": "0",
- "showname": "Time delta from previous displayed frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.time_relative",
- "pos": "0",
- "showname": "Time since reference or first frame: 0.000000000 seconds",
- "size": "0",
- "value": null,
- "show": "0.000000000",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.number",
- "pos": "0",
- "showname": "Frame Number: 1",
- "size": "0",
- "value": null,
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.len",
- "pos": "0",
- "showname": "Frame Length: 722 bytes (5776 bits)",
- "size": "0",
- "value": null,
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.cap_len",
- "pos": "0",
- "showname": "Capture Length: 722 bytes (5776 bits)",
- "size": "0",
- "value": null,
- "show": "722",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.marked",
- "pos": "0",
- "showname": "Frame is marked: False",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.ignored",
- "pos": "0",
- "showname": "Frame is ignored: False",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "frame.protocols",
- "pos": "0",
- "showname": "Protocols in frame: eth:ip:tcp:ssh",
- "size": "0",
- "value": null,
- "show": "eth:ip:tcp:ssh",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "eth",
- "pos": "0",
- "showname": "Ethernet II, Src: CadmusCo_96:a4:7a (08:00:27:96:a4:7a), Dst: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "14",
- "hide": null,
- "fields": [
- {
- "name": "eth.dst",
- "pos": "0",
- "showname": "Destination: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "6",
- "value": "0a0027000000",
- "show": "0a:00:27:00:00:00",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "eth.addr",
- "pos": "0",
- "showname": "Address: 0a:00:27:00:00:00 (0a:00:27:00:00:00)",
- "size": "6",
- "value": "0a0027000000",
- "show": "0a:00:27:00:00:00",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.lg",
- "pos": "0",
- "showname": ".... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)",
- "size": "3",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "0a0027",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.ig",
- "pos": "0",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "0a0027",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "eth.src",
- "pos": "6",
- "showname": "Source: CadmusCo_96:a4:7a (08:00:27:96:a4:7a)",
- "size": "6",
- "value": "08002796a47a",
- "show": "08:00:27:96:a4:7a",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "eth.addr",
- "pos": "6",
- "showname": "Address: CadmusCo_96:a4:7a (08:00:27:96:a4:7a)",
- "size": "6",
- "value": "08002796a47a",
- "show": "08:00:27:96:a4:7a",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.lg",
- "pos": "6",
- "showname": ".... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "080027",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "eth.ig",
- "pos": "6",
- "showname": ".... ...0 .... .... .... .... = IG bit: Individual address (unicast)",
- "size": "3",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "080027",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "eth.type",
- "pos": "12",
- "showname": "Type: IP (0x0800)",
- "size": "2",
- "value": "0800",
- "show": "0x0800",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "ip",
- "pos": "14",
- "showname": "Internet Protocol Version 4, Src: 192.168.66.121 (192.168.66.121), Dst: 192.168.66.1 (192.168.66.1)",
- "size": "20",
- "hide": null,
- "fields": [
- {
- "name": "ip.version",
- "pos": "14",
- "showname": "Version: 4",
- "size": "1",
- "value": "45",
- "show": "4",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.hdr_len",
- "pos": "14",
- "showname": "Header length: 20 bytes",
- "size": "1",
- "value": "45",
- "show": "20",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dsfield",
- "pos": "15",
- "showname": "Differentiated Services Field: 0x10 (DSCP 0x04: Unknown DSCP; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))",
- "size": "1",
- "value": "10",
- "show": "16",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.dsfield.dscp",
- "pos": "15",
- "showname": "0001 00.. = Differentiated Services Codepoint: Unknown (0x04)",
- "size": "1",
- "value": "4",
- "show": "0x04",
- "unmaskedvalue": "10",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dsfield.ecn",
- "pos": "15",
- "showname": ".... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)",
- "size": "1",
- "value": "0",
- "show": "0x00",
- "unmaskedvalue": "10",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.len",
- "pos": "16",
- "showname": "Total Length: 708",
- "size": "2",
- "value": "02c4",
- "show": "708",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.id",
- "pos": "18",
- "showname": "Identification: 0x7cd9 (31961)",
- "size": "2",
- "value": "7cd9",
- "show": "0x7cd9",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags",
- "pos": "20",
- "showname": "Flags: 0x02 (Don't Fragment)",
- "size": "1",
- "value": "40",
- "show": "0x02",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.flags.rb",
- "pos": "20",
- "showname": "0... .... = Reserved bit: Not set",
- "size": "1",
- "value": "40",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags.df",
- "pos": "20",
- "showname": ".1.. .... = Don't fragment: Set",
- "size": "1",
- "value": "40",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.flags.mf",
- "pos": "20",
- "showname": "..0. .... = More fragments: Not set",
- "size": "1",
- "value": "40",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.frag_offset",
- "pos": "20",
- "showname": "Fragment offset: 0",
- "size": "2",
- "value": "4000",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.ttl",
- "pos": "22",
- "showname": "Time to live: 64",
- "size": "1",
- "value": "40",
- "show": "64",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.proto",
- "pos": "23",
- "showname": "Protocol: TCP (6)",
- "size": "1",
- "value": "06",
- "show": "6",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.checksum",
- "pos": "24",
- "showname": "Header checksum: 0xb57f [correct]",
- "size": "2",
- "value": "b57f",
- "show": "0xb57f",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.checksum_good",
- "pos": "24",
- "showname": "Good: True",
- "size": "2",
- "value": "b57f",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.checksum_bad",
- "pos": "24",
- "showname": "Bad: False",
- "size": "2",
- "value": "b57f",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "ip.src",
- "pos": "26",
- "showname": "Source: 192.168.66.121 (192.168.66.121)",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.addr",
- "pos": "26",
- "showname": "Source or Destination Address: 192.168.66.121 (192.168.66.121)",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.src_host",
- "pos": "26",
- "showname": "Source Host: 192.168.66.121",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.host",
- "pos": "26",
- "showname": "Source or Destination Host: 192.168.66.121",
- "size": "4",
- "value": "c0a84279",
- "show": "192.168.66.121",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dst",
- "pos": "30",
- "showname": "Destination: 192.168.66.1 (192.168.66.1)",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.addr",
- "pos": "30",
- "showname": "Source or Destination Address: 192.168.66.1 (192.168.66.1)",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.dst_host",
- "pos": "30",
- "showname": "Destination Host: 192.168.66.1",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.host",
- "pos": "30",
- "showname": "Source or Destination Host: 192.168.66.1",
- "size": "4",
- "value": "c0a84201",
- "show": "192.168.66.1",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- }
- ]
- },
- {
- "name": "tcp",
- "pos": "34",
- "showname": "Transmission Control Protocol, Src Port: ssh (22), Dst Port: 55791 (55791), Seq: 1, Ack: 1, Len: 656",
- "size": "32",
- "hide": null,
- "fields": [
- {
- "name": "tcp.srcport",
- "pos": "34",
- "showname": "Source port: ssh (22)",
- "size": "2",
- "value": "0016",
- "show": "22",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.dstport",
- "pos": "36",
- "showname": "Destination port: 55791 (55791)",
- "size": "2",
- "value": "d9ef",
- "show": "55791",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.port",
- "pos": "34",
- "showname": "Source or Destination Port: 22",
- "size": "2",
- "value": "0016",
- "show": "22",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.port",
- "pos": "36",
- "showname": "Source or Destination Port: 55791",
- "size": "2",
- "value": "d9ef",
- "show": "55791",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.stream",
- "pos": "34",
- "showname": "Stream index: 0",
- "size": "0",
- "value": null,
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.len",
- "pos": "46",
- "showname": "TCP Segment Len: 656",
- "size": "1",
- "value": "80",
- "show": "656",
- "unmaskedvalue": null,
- "hide": "yes",
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.seq",
- "pos": "38",
- "showname": "Sequence number: 1 (relative sequence number)",
- "size": "4",
- "value": "12903044",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.nxtseq",
- "pos": "34",
- "showname": "Next sequence number: 657 (relative sequence number)",
- "size": "0",
- "value": null,
- "show": "657",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.ack",
- "pos": "42",
- "showname": "Acknowledgment number: 1 (relative ack number)",
- "size": "4",
- "value": "8b92f3e7",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.hdr_len",
- "pos": "46",
- "showname": "Header length: 32 bytes",
- "size": "1",
- "value": "80",
- "show": "32",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags",
- "pos": "46",
- "showname": "Flags: 0x018 (PSH, ACK)",
- "size": "2",
- "value": "18",
- "show": "0x0018",
- "unmaskedvalue": "8018",
- "hide": null,
- "fields": [
- {
- "name": "tcp.flags.res",
- "pos": "46",
- "showname": "000. .... .... = Reserved: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "80",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ns",
- "pos": "46",
- "showname": "...0 .... .... = Nonce: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "80",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.cwr",
- "pos": "47",
- "showname": ".... 0... .... = Congestion Window Reduced (CWR): Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ecn",
- "pos": "47",
- "showname": ".... .0.. .... = ECN-Echo: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.urg",
- "pos": "47",
- "showname": ".... ..0. .... = Urgent: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.ack",
- "pos": "47",
- "showname": ".... ...1 .... = Acknowledgment: Set",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.push",
- "pos": "47",
- "showname": ".... .... 1... = Push: Set",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.reset",
- "pos": "47",
- "showname": ".... .... .0.. = Reset: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.syn",
- "pos": "47",
- "showname": ".... .... ..0. = Syn: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.flags.fin",
- "pos": "47",
- "showname": ".... .... ...0 = Fin: Not set",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "18",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.window_size_value",
- "pos": "48",
- "showname": "Window size value: 501",
- "size": "2",
- "value": "01f5",
- "show": "501",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.window_size",
- "pos": "48",
- "showname": "Calculated window size: 501",
- "size": "2",
- "value": "01f5",
- "show": "501",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.window_size_scalefactor",
- "pos": "48",
- "showname": "Window size scaling factor: -1 (unknown)",
- "size": "2",
- "value": "01f5",
- "show": "-1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.checksum",
- "pos": "50",
- "showname": "Checksum: 0x0882 [validation disabled]",
- "size": "2",
- "value": "0882",
- "show": "0x0882",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.checksum_good",
- "pos": "50",
- "showname": "Good Checksum: False",
- "size": "2",
- "value": "0882",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.checksum_bad",
- "pos": "50",
- "showname": "Bad Checksum: False",
- "size": "2",
- "value": "0882",
- "show": "0",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.options",
- "pos": "54",
- "showname": "Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps",
- "size": "12",
- "value": "0101080a0014f4f811bdb98f",
- "show": "01:01:08:0a:00:14:f4:f8:11:bd:b9:8f",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "",
- "pos": "54",
- "showname": null,
- "size": "1",
- "value": "01",
- "show": "No-Operation (NOP)",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type",
- "pos": "54",
- "showname": "Type: 1",
- "size": "1",
- "value": "01",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type.copy",
- "pos": "54",
- "showname": "0... .... = Copy on fragmentation: No",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.class",
- "pos": "54",
- "showname": ".00. .... = Class: Control (0)",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.number",
- "pos": "54",
- "showname": "...0 0001 = Number: No-Operation (NOP) (1)",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "",
- "pos": "55",
- "showname": null,
- "size": "1",
- "value": "01",
- "show": "No-Operation (NOP)",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type",
- "pos": "55",
- "showname": "Type: 1",
- "size": "1",
- "value": "01",
- "show": "1",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "ip.opt.type.copy",
- "pos": "55",
- "showname": "0... .... = Copy on fragmentation: No",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.class",
- "pos": "55",
- "showname": ".00. .... = Class: Control (0)",
- "size": "1",
- "value": "0",
- "show": "0",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "ip.opt.type.number",
- "pos": "55",
- "showname": "...0 0001 = Number: No-Operation (NOP) (1)",
- "size": "1",
- "value": "1",
- "show": "1",
- "unmaskedvalue": "01",
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "",
- "pos": "56",
- "showname": null,
- "size": "10",
- "value": "080a0014f4f811bdb98f",
- "show": "Timestamps: TSval 1373432, TSecr 297646479",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.option_kind",
- "pos": "56",
- "showname": "Kind: Timestamp (8)",
- "size": "1",
- "value": "08",
- "show": "8",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.option_len",
- "pos": "57",
- "showname": "Length: 10",
- "size": "1",
- "value": "0a",
- "show": "10",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.options.timestamp.tsval",
- "pos": "58",
- "showname": "Timestamp value: 1373432",
- "size": "4",
- "value": "0014f4f8",
- "show": "1373432",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- },
- {
- "name": "tcp.options.timestamp.tsecr",
- "pos": "62",
- "showname": "Timestamp echo reply: 297646479",
- "size": "4",
- "value": "11bdb98f",
- "show": "297646479",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ],
- "protos": null
- },
- {
- "name": "tcp.analysis",
- "pos": "34",
- "showname": "SEQ/ACK analysis",
- "size": "0",
- "value": "",
- "show": "",
- "unmaskedvalue": null,
- "hide": null,
- "fields": [
- {
- "name": "tcp.analysis.bytes_in_flight",
- "pos": "34",
- "showname": "Bytes in flight: 656",
- "size": "0",
- "value": null,
- "show": "656",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ],
- "protos": null
- }
- ]
- },
- {
- "name": "ssh",
- "pos": "66",
- "showname": "SSH Protocol",
- "size": "656",
- "hide": null,
- "fields": [
- {
- "name": "ssh.encrypted_packet",
- "pos": "66",
- "showname": "Encrypted Packet: 5b2bfe1fa006867834412184af9f5b239737763adead7140...",
- "size": "656",
- "value": "5b2bfe1fa006867834412184af9f5b239737763adead71408fc01b88e548b2cc86f341a39771c6ed16f2b0bb3e6ab6109e73c7d68ca7545852f91930e4633c17fb9dc7aa794b0d820d0fa3ac65bf0f013e5449d5953d2943506657e2b76b548e67f5c9ce1a4c53db1b52465bde7208baf11f3fe01975418b4db186a38ad32947d1908b62e532da4b729353a932423d25f5f734484076aa4143c6a74937a4ea49448e261ae1ecb6b07bbdf5c98d0855940a19018c88263b8936f7b3e9a4b6cd98090fa10a10e37ad20fe5d833071ad6d5b2886ba85ec72affb83e316443dbe29dbf643e6aa05595c90765cf85f6da55cc1c09d8dccc7d05da022429ad602a559a044b7e2663b0c153a3011bf824ef8d1fa56cba957c5f5d2276a1c9e92de65782f406848c6e20f634c5d1fea843a8bf1a4058e85553f5838f7299958fbf54be84e46c5a3c3965f8bed7fe03a9a1168a892e0073adeb54deca171a318d11fc1a8179f91632310213da327965a40bc6fe18eae55e8da6b57d7ef9f3a05b42381bcb3db8f8efd6d0c638a2cdd46efb0b8f1274e98672f644b2275947e626b02e5166f86c2dd4a67b81e213f8c064927a396815db589f10e5e521ffedb13f8edbe2de01c6fc8bf0e12c82212e497794aa045e9b6fcca83b4cad0a3b5e6ca2d1feaf8887b4d64f22989396e
cfa8f7f1835eed422580505109fed36797bdc10a9168d5148daef6a8710c3df1d6366c9763ab4ebd359d86a8ea14819252fb52ba423422d1f60b0179316b3729e479ba07e88cb886938c8daae65d470dde91e5336e0fc4221a72cc49057d878aa5924875d097483e94bc44a4ea93aee8780e56c50a405932841f50da156e1f90559a7c4f76999442fb433a26fc703dea656bbe03790ac3c9c5318ff5f81d87d483524bbfe7ff167",
- "show": "5b:2b:fe:1f:a0:06:86:78:34:41:21:84:af:9f:5b:23:97:37:76:3a:de:ad:71:40:8f:c0:1b:88:e5:48:b2:cc:86:f3:41:a3:97:71:c6:ed:16:f2:b0:bb:3e:6a:b6:10:9e:73:c7:d6:8c:a7:54:58:52:f9:19:30:e4:63:3c:17:fb:9d:c7:aa:79:4b:0d:82:0d:0f:a3:ac:65:bf:0f:01:3e:54:49:d5:95:3d:29:43:50:66:57:e2:b7:6b:54:8e:67:f5:c9:ce:1a:4c:53:db:1b:52:46:5b:de:72:08:ba:f1:1f:3f:e0:19:75:41:8b:4d:b1:86:a3:8a:d3:29:47:d1:90:8b:62:e5:32:da:4b:72:93:53:a9:32:42:3d:25:f5:f7:34:48:40:76:aa:41:43:c6:a7:49:37:a4:ea:49:44:8e:26:1a:e1:ec:b6:b0:7b:bd:f5:c9:8d:08:55:94:0a:19:01:8c:88:26:3b:89:36:f7:b3:e9:a4:b6:cd:98:09:0f:a1:0a:10:e3:7a:d2:0f:e5:d8:33:07:1a:d6:d5:b2:88:6b:a8:5e:c7:2a:ff:b8:3e:31:64:43:db:e2:9d:bf:64:3e:6a:a0:55:95:c9:07:65:cf:85:f6:da:55:cc:1c:09:d8:dc:cc:7d:05:da:02:24:29:ad:60:2a:55:9a:04:4b:7e:26:63:b0:c1:53:a3:01:1b:f8:24:ef:8d:1f:a5:6c:ba:95:7c:5f:5d:22:76:a1:c9:e9:2d:e6:57:82:f4:06:84:8c:6e:20:f6:34:c5:d1:fe:a8:43:a8:bf:1a:40:58:e8:55:53:f5:83:8f:72:99:95:8f:bf:54:be:84:e4:6c:5a:3c:39:65:
f8:be:d7:fe:03:a9:a1:16:8a:89:2e:00:73:ad:eb:54:de:ca:17:1a:31:8d:11:fc:1a:81:79:f9:16:32:31:02:13:da:32:79:65:a4:0b:c6:fe:18:ea:e5:5e:8d:a6:b5:7d:7e:f9:f3:a0:5b:42:38:1b:cb:3d:b8:f8:ef:d6:d0:c6:38:a2:cd:d4:6e:fb:0b:8f:12:74:e9:86:72:f6:44:b2:27:59:47:e6:26:b0:2e:51:66:f8:6c:2d:d4:a6:7b:81:e2:13:f8:c0:64:92:7a:39:68:15:db:58:9f:10:e5:e5:21:ff:ed:b1:3f:8e:db:e2:de:01:c6:fc:8b:f0:e1:2c:82:21:2e:49:77:94:aa:04:5e:9b:6f:cc:a8:3b:4c:ad:0a:3b:5e:6c:a2:d1:fe:af:88:87:b4:d6:4f:22:98:93:96:ec:fa:8f:7f:18:35:ee:d4:22:58:05:05:10:9f:ed:36:79:7b:dc:10:a9:16:8d:51:48:da:ef:6a:87:10:c3:df:1d:63:66:c9:76:3a:b4:eb:d3:59:d8:6a:8e:a1:48:19:25:2f:b5:2b:a4:23:42:2d:1f:60:b0:17:93:16:b3:72:9e:47:9b:a0:7e:88:cb:88:69:38:c8:da:ae:65:d4:70:dd:e9:1e:53:36:e0:fc:42:21:a7:2c:c4:90:57:d8:78:aa:59:24:87:5d:09:74:83:e9:4b:c4:4a:4e:a9:3a:ee:87:80:e5:6c:50:a4:05:93:28:41:f5:0d:a1:56:e1:f9:05:59:a7:c4:f7:69:99:44:2f:b4:33:a2:6f:c7:03:de:a6:56:bb:e0:37:90:ac:3c:9c:53:18:ff:5f:81:d8:7d:48:35:24:bb:fe:7f:f1:67",
- "unmaskedvalue": null,
- "hide": null,
- "fields": null,
- "protos": null
- }
- ]
- }
- ]
-};
+ it('should extract timestamp fields', () => {
+ expect(component.ip.timestamp).toEqual({
+ "name": "timestamp",
+ "pos": "0",
+ "showname":
+ "Captured Time",
+ "size": "722",
+ "value": "1458240269.373968000",
+ "show": "Mar 17, 2016 18:44:29.373968000 UTC",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+
+ it('should extract ipSrcAddr fields', () => {
+ expect(component.ip.ipSrcAddr).toEqual({
+ "name": "ip.src",
+ "pos": "26",
+ "showname": "Source: 192.168.66.121 (192.168.66.121)",
+ "size": "4",
+ "value": "c0a84279",
+ "show": "192.168.66.121",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+
+ it('should extract ipSrcPort fields', () => {
+ expect(component.ip.ipSrcPort).toEqual({
+ "name": "tcp.srcport",
+ "pos": "34",
+ "showname": "Source port: ssh (22)",
+ "size": "2",
+ "value": "0016",
+ "show": "22",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+
+ it('should extract ipDestAddr fields', () => {
+ expect(component.ip.ipDestAddr).toEqual({
+ "name": "ip.dst",
+ "pos": "30",
+ "showname": "Destination: 192.168.66.1 (192.168.66.1)",
+ "size": "4",
+ "value": "c0a84201",
+ "show": "192.168.66.1",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+
+ it('should extract ipDestPort fields', () => {
+ expect(component.ip.ipDestPort).toEqual({
+ "name": "tcp.dstport",
+ "pos": "36",
+ "showname": "Destination port: 55791 (55791)",
+ "size": "2",
+ "value": "d9ef",
+ "show": "55791",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+
+ it('should extract protocol fields', () => {
+ expect(component.ip.protocol).toEqual({
+ "name": "ip.proto",
+ "pos": "23",
+ "showname": "Protocol: TCP (6)",
+ "size": "1",
+ "value": "06",
+ "show": "6",
+ "unmaskedvalue": null,
+ "hide": null,
+ "fields": null,
+ "protos": null
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/metron/blob/3e778592/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.html b/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.html
index 750c315..f7d9dbe 100644
--- a/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.html
+++ b/metron-interface/metron-alerts/src/app/pcap/pcap-packet/pcap-packet.component.html
@@ -11,11 +11,12 @@
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.
-->
-<div class="proto" *ngFor="let proto of packet.protos" (click)="proto.expanded = !proto.expanded">
- <div class="proto-header">{{ proto.showname }}</div>
- <div class="proto-fields" *ngIf="proto.expanded">
- <div *ngFor="let field of proto.fields">
- <span class="field-name">{{ field.name}}</span> {{ field.showname}}
+<div data-qe-id="proto" class="proto" *ngFor="let proto of packet.protos" (click)="proto.expanded = !proto.expanded">
+ <div data-qe-id="proto-showname" class="proto-header">{{ proto.showname }}</div>
+ <div data-qe-id="proto-fields" class="proto-fields" *ngIf="proto.expanded">
+ <div data-qe-id="proto-field" *ngFor="let field of proto.fields">
+ <span data-qe-id="proto-field-name" class="field-name">{{ field.name }}</span>
+ <span data-qe-id="proto-field-showname">{{ field.showname }}</span>
</div>
</div>
</div>