Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home

Yoshiyuki Kurauchi wmnsk

:octocat:
Working from home
View GitHub Profile
@wmnsk
wmnsk / enb-metrics.log
Created Jan 19, 2020
Metrics exposed for Prometheus in GW Tester
View enb-metrics.log
# HELP enb_active_bearers number of GTP-U tunnels established currently
# TYPE enb_active_bearers gauge
enb_active_bearers 1
# HELP enb_active_sessions number of session established currently
# TYPE enb_active_sessions gauge
enb_active_sessions 5
# HELP enb_messages_received_total number of messages received by messagge type
# TYPE enb_messages_received_total counter
enb_messages_received_total{src="172.21.1.12:36412",type="Attach Response"} 5
# HELP enb_messages_sent_total number of messages sent by messagge type
View gtpc_pktgen.py
# -*- coding: utf-8 -*-
import dpkt
import sys
import socket
cli_mac = bytes(bytearray.fromhex('080042000001'))
srv_mac = bytes(bytearray.fromhex('080042000002'))
ethtype = dpkt.ethernet.ETH_TYPE_IP
@wmnsk
wmnsk / dpkt_radiuspktgen.py
Last active Jan 17, 2017
Test code snippet for kbandla/dpkt PR#320
View dpkt_radiuspktgen.py
# -*- coding: utf-8 -*-
from __future__ import print_function
import dpkt
import sys
import socket
from binascii import hexlify as hx
outfile = open(sys.argv[1], 'wb')
View dpktSCTP_testbypcap.py
#!/usr/bin/env python
import dpkt
import sys
import binascii
with open(sys.argv[1], "rb") as f:
pcr = dpkt.pcap.Reader(f)
x = 1
for t, buf in pcr: