2009/12/8 Report 報告學生 : 黃健瑋 指導教授 : 李正帆 1. Content seq_file structure proc file Data structure(not completed) 2.

Slides:



Advertisements
Similar presentations
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
Advertisements

Singly Linked List BTECH, EE KAZIRANGA UNIVERSITY.
2012 = 2 2 * 503 Might be useful tomorrow. – MG. PotW Solution int dp(int pos, int k) { if (k > lim) return -(1
控制原理與設計期中報告 指導教授:曾慶耀 學 號: 學 生:楊長諺.  Introduction  System Modeling of the PMAC Motor  Neural - Network - Based Self - Tuning PI Control System.
Data Structure Lecture-5
R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
C Intro.
String Searching Algorithm
指導教授: 曾慶耀 老師 李信德 老師 學生: 潘酩杉 日期: 11.8
Union, bitfield, typedef, enum union nama_u{ }; union nama_u{ struct nama_s byte; }; enum{ }; Tipedef var BYTE.
M M S S V V 0 MSVLAB, HRE, NTOU BEM 期末報告 報 告 人 : 李應德 先生 指導教授 : 陳正宗 終身特聘教授 時 間 : 2009 年 03 月 24 日 地 點 : 河工二館 307 室 Multiple-ellipses problem 積分方程特論.
1999/7/6Li-we Pan1 Semester Report 指導老師 : 何正信教授 學生:潘立偉 學號: M 日期: 88/7/6.
M M S S V V 0 MSVLAB, HRE, NTOU BEM 期末報告 報 告 人 : 李應德 先生 指導教授 : 陳正宗 終身特聘教授 時 間 : 2009 年 03 月 24 日 地 點 : 河工二館 307 室 Multiple-ellipses problem 積分方程特論.
The interaction of waves with arrays of vertical circular cylinders
1 Eigenanalysis for a concentric sphere using BEM and BIEM 報告學生:高聖凱 指導教授:陳正宗終身特聘教授 時間: 2008/06/24.
M M S S V V 0 MSVLAB, HRE, NTOU BEM 期末報告 報 告 人 : 李應德 先生 指導教授 : 陳正宗 終身特聘教授 時 間 : 2008 年 06 月 24 日 地 點 : 河工二館 307 室 Two spherical body 邊界元素法期末報告.
Pointers Example Use int main() { int *x; int y; int z; y = 10; x = &y; y = 11; *x = 12; z = 15; x = &z; *x = 5; z = 8; printf(“%d %d %d\n”, *x, y, z);
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
Pointers CSE 2451 Rong Shi.
Project 2 Data Communication Spring 2010, ICE Stephen Kim, Ph.D.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 10. Pointers & Dynamic Data Structures.
Advance Use of Structures CHAPTER 5. C.10 1 Using Structures with Functions » A function can return only one value back. » Some of the processes may yield.
…WHAT YOU SHOULD HAVE LEARNED IN ETEC1101… IN JAVA 2. C => JAVA.
Project Monitoring and Control 指導教授:李健興老師 學生:黃麟凱同學 學號: R 學號: R
C Programming Tutorial – Part I CS Introduction to Operating Systems.
Functions, Pointers, Structures Keerthi Nelaturu.
CPT: Arrays of Pointers/ Computer Programming Techniques Semester 1, 1998 Objectives of these slides: –to illustrate the use of arrays.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Variables and Data Types.  Variable: Portion of memory for storing a determined value.  Could be numerical, could be character or sequence of characters.
Weeks 5-6 Pointers and Arrays Basic pointer type Pointers and Arrays Address arithmetic Pointer Arrays User-defined data types Structures Unions Pointers.
Struct 1. Definition: Using struct to define a storage containing different types. For example it can contain int, char, float and array at the same time.
Generic lists Vassilis Athitsos. Problems With Textbook Interface? Suppose that we fix the first problem, and we can have multiple stacks. Can we have.
MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology SDL_net Client-Server Example Spring 2012.
指導教授 : 劉如生 老師 報告者 : 楊凱翔、張云臙.  Introduction  Related Works  System Architectures  System Implementations  Conclusions.
Computer Programming for Engineering Applications ECE 175 Intro to Programming.
Smart and Secure Home 指導教授:曾建超 教授 學生:何承運、郭冠廷、陳佩玟、林詩庭 Computer Science
Ad hoc on-demand backup node setup routing protocol 指導教授:石 貴 平 報告學生:莊 宗 翰 報告日期: 2003/03/13 Wang, Y.H.; Chung, C.M.; Chuang, C.C. IEEE Information Networking,
Architecture and algorithms for an IEEE based multi-channel wireless mesh network 指導教授:許子衡 老師 學生:王志嘉.
On-Demand, Link-State, Multi-Path QoS Routing in a Wireless Mobile Ad-Hoc Network 指導教授:石 貴 平 報告學生:莊 宗 翰 報告日期: 2003/04/24 Yuh-Shyan Chen, Yu-Chee Tseng,
1 EPSII 59:006 Spring Random Access Files—A Design Example Problem statement:  Consider a very large file—e.g. millions of records  Impractical.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
CS162 - Topic #6 Lecture: Pointers and Dynamic Memory –Review –Dynamically allocating structures –Combining the notion of classes and pointers –Destructors.
南台科技大學 資訊工程系 An effective solution for trademark image retrieval by combining shape description and feature matching 指導教授:李育強 報告者 :楊智雁 日期 : 2010/08/27.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Time-stable geocast for ad hoc networks and its application with virtual warning signs Volume 27, Issue 11, 1 July 2004, Pages Applications and.
 Review building a complete linked list  List traversal in main ( )  List traversal using a function.
Arrays and Sorting. Process Open a file that contains integers, one per line. Read each line, convert to short and store each into an array Sort the array.
Pointers. Pointer Arithmetic Since arrays consist of contiguous memory locations, we can increment (or decrement) the addresses to move through the array.
Functions, Part 2 of 2 Topics Functions That Return a Value
C Programming Tutorial – Part I
Reserved Words.
Recursion.
null, true, and false are also reserved.
Stock market and foreign exchange market integration in South Africa
Too Much Milk With Locks
Too Much Milk With Locks
Prof. Bhushan Trivedi Director GLS Institute of Computer Technology
Default Arguments.
Object-Oriented Programming (OOP) Lecture No. 20
class PrintOnetoTen { public static void main(String args[]) {
Introduction to Programming
Programming Language C Language.
프로그래밍2 및 실습 Sort Code 전명중.
Building Blocks of C Programming Language
Too Much Milk With Locks
Growing Arrays in C Nathan Lee.
Lecture 24.
컴퓨터 프로그래밍 기초 - 13th : 마지막 수업 -
Presentation transcript:

2009/12/8 Report 報告學生 : 黃健瑋 指導教授 : 李正帆 1

Content seq_file structure proc file Data structure(not completed) 2

seq_file 1/4 static void *my_seq_start(struct seq_file *s, loff_t *pos) { if (*pos >= CLIENT_SIZE) { …… return NULL; } …… return (void *)((unsigned long) *pos); } 3

seq_file 2/4 static void *my_seq_next(struct seq_file *s, void *v, loff_t *pos) { ++(*pos); if(*pos >= CLIENT_SIZE) { return NULL; } return (void *)((unsigned long)*pos); } 4

seq_file 3/4 static void my_seq_stop(struct seq_file *s, void *v) { /* nothing to do, we use a static value in start() */ …… } 5

seq_file 4/4 static int my_seq_show(struct seq_file *s, void *v) { …… n = (int)v; if(proc[n].dstIP == 0) return 0; IpAddressToString(proc[n].dstIP, temp); seq_printf(s, "%s %d\n", temp, proc[n].dstPort); seq_printf(s, "%s\n", proc[n].chnName); seq_printf(s, "%d\n", (int)proc[n].tStamp); seq_printf(s, "%d\n", proc[n].num); for(i = 0; i < proc[n].num; i++) { IpAddressToString(proc[n].peer[i].peerIP, temp); seq_printf(s, "%s %d\n", temp, proc[n].peer[i].peerPort); } return 0; } 6

7

proc file proc file added: deleteClient Delete client –echo IP >> /proc/deleteClient 8

Date structure 1/3 struct _proc { unsigned short num; struct _client client[CLIENT_SIZE] char chnName[100]; struct _peer peer[PEER_LIST_SIZE]; }; 9

Data structure 2/3 4kb problem –One channel data too big 10

Data structure 3/3 Solution: 11

Reference