This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Basic IPv4 router (static routing) in Python. | |
''' | |
import sys | |
import os | |
import time | |
from switchyard.lib.packet import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Data to be collected on Ubuntu vm running on VirtualBox. (2 GB RAM) | |
#uname -a | |
Linux adminuser-VirtualBox 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux | |
- The 'heart' of the zoned buddy allocator is the following function(in mm/page_alloc.c) | |
struct page * | |
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | |
struct zonelist *zonelist, nodemask_t *nodemask) | |
- The following tracepoint is present in this function: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Ethernet learning switch in Python: HW3. | |
Note that this file currently has the code to implement a "hub" | |
in it, not a learning switch. (I.e., it's currently a switch | |
that doesn't learn.) | |
''' | |
from switchyard.lib.address import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code snippet can be used to dump a skb, so that with minimum postprocessing | |
// it can be fed to text2pcap for converting into a pcap file which can be analyzed | |
// in wireshark | |
do { | |
int i; | |
printk("\n"); | |
printk("000000 "); | |
for (i = 0 ; i < skb->len; i++) { | |
printk("%02x ", ((u8*)skb->data)[i]); |