1 /* 2 * client.h 3 * 4 * Copyright (c) 2003 Marius Aamodt Eriksen <marius@monkey.org> 5 * All rights reserved. 6 * 7 * $Id: client.h,v 1.7 2003/04/15 05:44:53 marius Exp $ 8 */ 9 10 #ifndef TRICKLE_CLIENT_H 11 #define TRICKLE_CLIENT_H 12 13 #define CLIENT_CONFIGURED 0x01 14 #define CLIENT_ONQUEUE 0x02 15 #define CLIENT_SPECTATOR 0x04 16 17 struct client { 18 SPLAY_ENTRY(client) next; 19 int s; 20 struct event ev; 21 int flags; 22 23 pid_t pid; 24 char argv0[256]; 25 uid_t uid; 26 char uname[256]; 27 gid_t gid; 28 char gname[256]; 29 30 struct timeval starttv; 31 32 uint lim[2]; 33 uint pri; 34 struct bwstat *stat; 35 uint lsmooth; 36 double tsmooth; 37 38 struct timeval delaytv; 39 struct event delayev; 40 int delaylen; 41 short delaywhich; 42 43 TAILQ_ENTRY(client) nextq; 44 TAILQ_ENTRY(client) nextp; 45 }; 46 47 void client_init(uint); 48 int client_register(struct client *); 49 int client_configure(struct client *); 50 void client_unregister(struct client *); 51 void client_delay(struct client *, short, size_t, uint); 52 void client_getdelay(struct client *, short, size_t, uint); 53 void client_update(struct client *, short, size_t); 54 int client_sendmsg(struct client *, struct msg *); 55 int client_recvmsg(struct client *, struct msg *); 56 void client_printrates(void); 57 void client_getinfo(struct client *, uint, uint); 58 void client_force(void); 59 60 #endif /* TRICKLE_CLIENT_H */ 61