Sponsored Content
Full Discussion: counting the packets
Special Forums IP Networking counting the packets Post 302096550 by !_30 on Thursday 16th of November 2006 08:13:49 AM
Old 11-16-2006
Tcpdump , ethereal , not worthy ? Multithreaded aplication ? Smilie


If you wanna measure/count how many bytes does a client receive ( on the server side ) , you can easily implement a contor , for receive bytes.Suposing that all byte's receive by one client are send by the server , it's easy to make something like :

Code:
send(j,da,sizeof(da), 0);

Let's say da is the string passed to the client ( a client J ).You incremenent a contor so measure how many bytes are transfered to the client.

Let's say I send 4 bytes to the client ( once ) and then 3 .. I can do this.

Code:
int j;
int TRAFIC=0; /* start 0 bytes transfered to client j */
nbytes=send(da,sizeof(da),0);
TRAFIC=TRAFIC+nbytes;

So if all trafic to a specified client , is send by the server to that client , you can easily count how many bytes , are received by the client J .


Hope it help !
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sending packets

How can i send a packet, and what is an empty packet? (8 Replies)
Discussion started by: Avatar0fEvil
8 Replies

2. IP Networking

Redirecting outgoing packets

I'd like to find out how to redirect Outbound packets. So instead of having packets go to IP1 as they normally would, have them go to IP2 instead. I believe this is possible using IPFW but I'm not sure. I've played with it, but haven't gotten too far. Any ideas would be appreciated. (1 Reply)
Discussion started by: Seraph
1 Replies

3. Programming

Packets Getting Lost

I am working on a project, which has the following type of hardware setup. A special hardware device is receiving data from an external network interface. So we can have multiple such a hardware devices. Now these hardware devices will route the captured incoming data through the external... (4 Replies)
Discussion started by: S.P.Prasad
4 Replies

4. UNIX for Dummies Questions & Answers

Dumping network packets

Hi, My Solaris Workstation has got 4 NICS, out of which one of them(bge3) is unplugged from the rest of the external network & connected to other interface(bge1). The isolated NIC serves as a simulated Ethernet Interface for my application under development. Now, I'd like to capture RAW... (1 Reply)
Discussion started by: smanu
1 Replies

5. UNIX for Advanced & Expert Users

ethernet packets counting

salutation experts, I want to counting arrival and outgoing packets in a specific interval (ethernet interface), what library or method you offer me that i can use it in c lang? tnx (1 Reply)
Discussion started by: galaxy.ice
1 Replies

6. Shell Programming and Scripting

send packets

Hello I need to send some packets to check connection. Packets will be catch by snoop. Is there any Sun tool to send some packets on selected IP and Port? Thx (1 Reply)
Discussion started by: miojamo
1 Replies

7. HP-UX

packets statistics

Hi there, are there any functions that can get the packets statistics on UNIX ? thanks. (2 Replies)
Discussion started by: Frank2004
2 Replies

8. Infrastructure Monitoring

Accept SNMP Packets...

hi guys I've configured snmp on some linux snmpd.conf rocommunity com_read x.x.x.10 rwcommunity com_write x.x.x.10 Now one of my coworkers asked to do the same that he does on windows for my linux.... But I have no idea how to configure that basically when SNMP is configure there... (5 Replies)
Discussion started by: karlochacon
5 Replies

9. Solaris

multitude of packets from 127.0.0.1

I was checking routing table, and noticed that our server has a lot packets from localhost: Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- .. 127.0.0.1 127.0.0.1 ... (1 Reply)
Discussion started by: orange47
1 Replies

10. IP Networking

Route packets over specified interface

Hi, I'm quite new to unix networking and ip tables. I'm running a debian (htpc) server with two NIC's; eth0 and wlan0. I'm trying to set it up in a way that eth0 is the default interface for internet, but some processes should run through wlan0. For example, I'm using eth0 for downloads... (2 Replies)
Discussion started by: Subbeh
2 Replies
SSL_get_client_CA_list(3)					      OpenSSL						 SSL_get_client_CA_list(3)

NAME
SSL_get_client_CA_list, SSL_CTX_get_client_CA_list - get list of client CAs SYNOPSIS
#include <openssl/ssl.h> STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); DESCRIPTION
SSL_CTX_get_client_CA_list() returns the list of client CAs explicitly set for ctx using SSL_CTX_set_client_CA_list(3). SSL_get_client_CA_list() returns the list of client CAs explicitly set for ssl using SSL_set_client_CA_list() or ssl's SSL_CTX object with SSL_CTX_set_client_CA_list(3), when in server mode. In client mode, SSL_get_client_CA_list returns the list of client CAs sent from the server, if any. RETURN VALUES
SSL_CTX_set_client_CA_list() and SSL_set_client_CA_list() do not return diagnostic information. SSL_CTX_add_client_CA() and SSL_add_client_CA() have the following return values: STACK_OF(X509_NAMES) List of CA names explicitly set (for ctx or in server mode) or send by the server (client mode). NULL No client CA list was explicitly set (for ctx or in server mode) or the server did not send a list of CAs (client mode). SEE ALSO
ssl(3), SSL_CTX_set_client_CA_list(3), SSL_CTX_set_client_cert_cb(3) 1.0.1e 2013-02-11 SSL_get_client_CA_list(3)
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy