最近在学习使用python进行网络编程。 本来使用c没问题的,但是python的语法太精练了,忍不住使用python了,这样就需要学习python前辈留下的许多强大的Lib库,其中之一就是dpkt。 先从入口程序看起:dpkt.py dpkt定义了Packet类,这是所有其他dpkt定义的网络报文类型的基础类。Packet类继承自Object。 1、ip,icmp等等子类都继承自dpkt class,每个子类都会定义一个__hdr__结构,该结构代表报文的头结构,是一个元组,其中包含若干个...
by alexnetwork - Python文档中心 - 2009-01-07 10:55:51 阅读(1699) 回复(0)
In our first and second dpkt tutorials, we looked at the simple construction and parsing of packets respectively. Our third tutorial combines both parsing and construction of packets in a single utility for performing DNS spoofing (a la dsniff’s dnsspoof). dpkt is a sweet framework for creating and parsing packets. While dpkt doesn’t have much documentation, once you get the hang of using ...
In this dpkt tutorial, I will demonstrate how to construct and send a simple ICMP echo packet. dpkt is a sweet framework for creating and parsing packets. While dpkt doesn’t have much documentation, once you get the hang of using one module, the rest fall into place fairly easily. I’ll be doing a number of dpkt tutorials with simple tasks in hopes of providing some “documentation by example”...
Small bulk INCAR System=bulk-GaAs DOS related values ISMEAR=-5 Electronic minimisation ENCUT=215 ! EMax for Ga !ENAUG=335.0 KPOINTS Monkhorst Pack 0 Monkhorst Pack 11 11 11 0 0 0 Supercell INCAR !ISPIN=2 DOS related values ISMEAR=0 SIGMA=0.05 Electronic minimisation NELECT=585 !chg 0 (neutral 585) NSW=30 IBRION=2 NELMIN = 4 EDIFF = 1E-4 EDIFFG = -0.05 ENCUT = 262 ! ENMIN for N LREAL = .TRUE. KPOIN...
Small bulk INCAR System=bulk-GaAs DOS related values ISMEAR=-5 Electronic minimisation ENCUT=215 ! EMax for Ga !ENAUG=335.0 KPOINTS Monkhorst Pack 0 Monkhorst Pack 11 11 11 0 0 0 Supercell INCAR !ISPIN=2 DOS related values ISMEAR=0 SIGMA=0.05 Electronic minimisation NELECT=585 !chg 0 (neutral 585) NSW=30 IBRION=2 NELMIN = 4 EDIFF = 1E-4 EDIFFG = -0.05 ENCUT = 262 ! ENMIN for N LREAL = .TRUE. KPOIN...
Struts example Struts is modeled after the MVC design pattern, you can follow a standard development process for all of your Struts Web applications. ...
http://wiki.laptop.org/go/GStreamer#examples http://article.gmane.org/gmane.comp.video.gstreamer.devel/20240 附加: gst-launch v4l2src ! videorate ! video/x-raw-yuv,width=1280,height=1024 ! videoscale ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! xvimagesink 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/66419/showart_2059373.html
Bash by example Summary: By learning how to program in the bash scripting language, your day-to-day interaction with Linux will become more fun and productive, and you'll be able to build upon those standard UNIX constructs (like pipelines and redirection) that you already know and love. In this three-part series, Daniel Robbins will teach you how to program in bash by example. He'll cover the...
by tangke 2009-09-07 这是同事写的两个shell script 1.update.sh #!/bin/bash set -e server="http://172.16.20.99/tmp" download_list=(Student rdesktop_loongson_1.0.3_mipsel.tar.gz static_ip.sh) echo "Download files..." for d in "${download_list[@]}" do rm -f "$d" wget "${server}/${d}" done . static_ip.sh echo "Install rdesktop_loongson..." tar xzpf rdesktop_loongson_1.0.3_mipsel.tar.gz -C / ec...
#include sys/types.h> #include netinet/in.h> #include sys/event.h> #include sys/time.h> #include sys/socket.h> #include sys/types.h> #include arpa/inet.h> #include unistd.h> #include stdlib.h> #include string.h> #include stdio.h> #define err(msg) perror(msg) #define SA struct sockaddr struct event { int fd; void (*handle)(struct event *); }; static int tcp_listen(void) { ...