Skip to content

Instantly share code, notes, and snippets.

View wmnsk's full-sized avatar
:octocat:
Working from home

Yoshiyuki Kurauchi wmnsk

:octocat:
Working from home
View GitHub Profile
@wmnsk
wmnsk / enb-metrics.log
Created January 19, 2020 11:47
Metrics exposed for Prometheus in GW Tester
# 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
@wmnsk
wmnsk / gtpc_pktgen.py
Last active February 6, 2017 14:56
Test snippet for GTP-C implementaion on dpkt(https://github.com/wmnsk/dpkt/tree/gtpc_implementation)
# -*- 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 January 17, 2017 08:53
Test code snippet for kbandla/dpkt PR#320
# -*- 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')
@wmnsk
wmnsk / dpktSCTP_testbypcap.py
Last active December 2, 2016 05:29
Snippet to test dpkt SCTP enhancement (https://github.com/kbandla/dpkt/pull/309)
#!/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: