File: client.h

package info (click to toggle)
trickle 1.07-10
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,664 kB
  • ctags: 539
  • sloc: sh: 8,307; ansic: 4,722; makefile: 77
file content (60 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * client.h
 *
 * Copyright (c) 2003 Marius Aamodt Eriksen <marius@monkey.org>
 * All rights reserved.
 *
 * $Id: client.h,v 1.7 2003/04/15 05:44:53 marius Exp $
 */

#ifndef TRICKLE_CLIENT_H
#define TRICKLE_CLIENT_H

#define CLIENT_CONFIGURED 0x01
#define CLIENT_ONQUEUE    0x02
#define CLIENT_SPECTATOR  0x04

struct client {
	SPLAY_ENTRY(client)  next;
	int                  s;
	struct event         ev;
	int                  flags;

	pid_t                pid;
	char                 argv0[256];
	uid_t                uid;
	char                 uname[256];
	gid_t                gid;
	char                 gname[256];

	struct timeval       starttv;

	uint                 lim[2];
	uint                 pri;
	struct bwstat       *stat;
	uint                 lsmooth;
	double               tsmooth;

	struct timeval       delaytv;
	struct event         delayev;
	int                  delaylen;
	short                delaywhich;

	TAILQ_ENTRY(client)  nextq;
	TAILQ_ENTRY(client)  nextp;
};

void            client_init(uint);
int             client_register(struct client *);
int             client_configure(struct client *);
void            client_unregister(struct client *);
void            client_delay(struct client *, short, size_t, uint);
void            client_getdelay(struct client *, short, size_t, uint);
void            client_update(struct client *, short, size_t);
int             client_sendmsg(struct client *, struct msg *);
int             client_recvmsg(struct client *, struct msg *);
void            client_printrates(void);
void            client_getinfo(struct client *, uint, uint);
void            client_force(void);

#endif /* TRICKLE_CLIENT_H */