catalinux / Conn (public) (License: LGPLv2) (since 2016-03-01) (hash sha1)
Net library for easy building ipv4/ipv6 network daemons/clients
List of commits:
Subject Hash Author Date (UTC)
Improved status logging. 54fea00d8f16127244fd15b209c24f606adb20b3 Catalin(ux) M. BOIE 2009-08-25 17:33:14
Added Conn_strcasestr for case insensitive search in buffer. ca14b37b2a1f23887ad12fed729a3dd0ff253443 Catalin(ux) M. BOIE 2009-08-24 17:18:24
Improved ntime example. b63de9b82ffab1c0d759571a40f1d72f9b8df927 Catalin(ux) M. BOIE 2009-08-24 17:09:21
Removed unused includes. 8af81a4c311caa7d738000a5208d01d7620d1040 Catalin(ux) M. BOIE 2009-08-21 18:57:33
Improved blackhole example. 2fd7ff181a412f4ba060b0e89b97acdf89a8fb88 Catalin(ux) M. BOIE 2009-08-21 18:03:22
Fixed connections to outside. Still, it is a little mess there. 417ccd4a48508a810377676658d51c5103168472 Catalin(ux) M. BOIE 2009-08-21 17:42:37
addr and bind_addr are not pointers! Corrected them. e1deeb765500ee079802c2cd6543f9c9496d8f9b Catalin(ux) M. BOIE 2009-08-21 16:49:24
Exported _alloc and _commit functions. 9a3159e89eff020cfb75b9eec49a45a637a6da57 Catalin(ux) M. BOIE 2009-08-21 16:39:27
Added blackhole example. 8a7ac49b018ad65ba386f8a50725745127b4cbd2 Catalin(ux) M. BOIE 2009-08-21 15:54:55
TODO in/out. fdcfbf9e18ed5fbe0135b9aa702e09432fa71e93 Catalin(ux) M. BOIE 2009-08-21 15:53:05
First chunk of generic socket handling. b9a488ba615c4322b5d116a29919f11fd476b200 Catalin(ux) M. BOIE 2009-08-21 15:50:45
Added ntime example (returns CLOCK_REALTIME as fast as it can). e2fa318caf3e9aea09a853ab2b4af4b5a2cc8261 Catalin(ux) M. BOIE 2009-08-20 15:41:20
TODO ins and outs. 66a987be5d8e08ef6fe1ce0c056b8c3acd65bdb7 Catalin(ux) M. BOIE 2009-08-20 15:36:14
Cosmetic change. 5dab6539af2ca97f3f3f9b55e20be7d6f423829e Catalin(ux) M. BOIE 2009-08-20 15:34:01
Abort if current slot is in state FREE. It must not happen. 14dc9f444309cddd46996a47277cefe4eec77db5 Catalin(ux) M. BOIE 2009-08-20 15:33:31
Clean a slot only after we move it in the end. This fixes an infinite loop if last and first slots were both in state FREE. eecc6decaea6801235aa7a02d193782e1accc58f Catalin(ux) M. BOIE 2009-08-20 15:32:38
Cosmetic changes. c147533732f8b7b4bbe2725f04bcce0df0271c70 Catalin(ux) M. BOIE 2009-08-20 15:31:12
Call del_obj only if we have a valid file descriptor. 95c90269de0fa59a6ea69c2067827bbf57db16d5 Catalin(ux) M. BOIE 2009-08-20 15:29:42
Conn_enqueue returns now the number of bytes queued or -1. You should really check the error code. ab88f823936ad67ba08aa5fd7984ea735c6c7dd7 Catalin(ux) M. BOIE 2009-08-20 15:28:42
Added CONN_STATE_ERROR. e20e518e10f686eb0b248ae23fe193ea7344594b Catalin(ux) M. BOIE 2009-08-20 15:27:50
Commit 54fea00d8f16127244fd15b209c24f606adb20b3 - Improved status logging.
Signed-off-by: Catalin(ux) M. BOIE <catab@embedromix.ro>
Author: Catalin(ux) M. BOIE
Author date (UTC): 2009-08-25 17:33
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2009-09-02 15:42
Parent(s): ca14b37b2a1f23887ad12fed729a3dd0ff253443
Signing key:
Tree: d567f452f8695a95db9cea32dffd2aa44661dbde
File Lines added Lines deleted
Conn_engine_core.c 25 11
File Conn_engine_core.c changed (mode: 100644) (index 0fb3764..2ab17ce)
... ... char *Conn_type(const struct Conn *C)
363 363 } }
364 364 } }
365 365
366 char *Conn_protocol(const struct Conn *C)
367 {
368 switch (C->sock_protocol) {
369 case IPPROTO_IP: return "IP";
370
371 default: return "?";
372 }
373 }
374
366 375 static char *Conn_socktype(const struct Conn *C) static char *Conn_socktype(const struct Conn *C)
367 376 { {
368 377 switch (C->type) { switch (C->type) {
 
... ... char *Conn_status_slot(const struct Conn *C)
429 438 Conn_speed(speedi, sizeof(speedi), si); Conn_speed(speedi, sizeof(speedi), si);
430 439 Conn_speed(speedo, sizeof(speedo), so); Conn_speed(speedo, sizeof(speedo), so);
431 440
432 snprintf(tmp, sizeof(tmp), "%4d fd%4d"
433 " %4s %6s %5s %6s"
434 " %39s/%-5d\n"
435 " Via%llu [%s][%s] IO=%llu/%llu"
441 snprintf(tmp, sizeof(tmp), "id=%llu slot=%d fd=%d"
442 " %s/%s/%s"
443 " %s %s"
444 " %s/%d <-> %s/%d"
445 "via=%llu [%s][%s] IO=%llu/%llu"
436 446 " BS=%u/%u S=%s/%s" " BS=%u/%u S=%s/%s"
437 " T=%ld bw=%u f=%u tk=%u id=%llu [%s]\n",
438 C->slot, C->fd,
439 Conn_domain(C), Conn_type(C), Conn_socktype(C), Conn_state(C),
440 C->addr, C->port,
447 " T=%ld bw=%u f=%u tk=%u [%s]\n",
448 C->id, C->slot, C->fd,
449 Conn_domain(C), Conn_type(C), Conn_protocol(C),
450 Conn_socktype(C), Conn_state(C),
451 C->bind_addr, C->bind_port, C->addr, C->port,
441 452 C->via, polle, pollr, C->bi, C->bo, C->via, polle, pollr, C->bi, C->bo,
442 453 C->ibuf_size, C->obuf_size, speedi, speedo, C->ibuf_size, C->obuf_size, speedi, speedo,
443 454 Conn_now.tv_sec - C->start, Conn_now.tv_sec - C->start,
444 455 C->band_width, C->band_factor, C->band_tokens, C->band_width, C->band_factor, C->band_tokens,
445 C->id, flags);
456 flags);
446 457
447 458 return tmp; return tmp;
448 459 } }
 
... ... char *Conn_status_slot_html(const struct Conn *C)
470 481 ext = Conn_status_slot_html_cb(C); ext = Conn_status_slot_html_cb(C);
471 482
472 483 snprintf(tmp, sizeof(tmp), "<td>%llu</td><td>%d</td><td>%d</td>" snprintf(tmp, sizeof(tmp), "<td>%llu</td><td>%d</td><td>%d</td>"
473 "<td>%s</td><td>%s</td><td>%s</td><td>%s</td>"
484 "<td>%s</td><td>%s</td><td>%s</td>"
485 "<td>%s</td><td>%s</td>"
474 486 "<td>%s/%d</td>" "<td>%s/%d</td>"
475 487 "<td>%llu</td><td>%s</td><td>%s</td><td>%llu / %llu</td>" "<td>%llu</td><td>%s</td><td>%s</td><td>%llu / %llu</td>"
476 488 "<td>%u / %u</td><td>%s / %s</td><td>%ld</td>" "<td>%u / %u</td><td>%s / %s</td><td>%ld</td>"
477 489 "<td>%u</td><td>%u</td><td>%u</td>" "<td>%u</td><td>%u</td><td>%u</td>"
478 490 "%s\n", "%s\n",
479 491 C->id, C->slot, C->fd, C->id, C->slot, C->fd,
480 Conn_domain(C), Conn_type(C), Conn_socktype(C), Conn_state(C),
492 Conn_domain(C), Conn_type(C), Conn_protocol(C),
493 Conn_socktype(C), Conn_state(C),
481 494 C->addr, C->port, C->via, polle, pollr, C->bi, C->bo, C->addr, C->port, C->via, polle, pollr, C->bi, C->bo,
482 495 C->ibuf_size, C->obuf_size, C->ibuf_size, C->obuf_size,
483 496 speedi, speedo, Conn_now.tv_sec - C->start, speedi, speedo, Conn_now.tv_sec - C->start,
 
... ... char *Conn_status(const unsigned int flags)
529 542 strcat(buf, "<td>FD</td>"); strcat(buf, "<td>FD</td>");
530 543 strcat(buf, "<td>Dom</td>"); strcat(buf, "<td>Dom</td>");
531 544 strcat(buf, "<td>Type</td>"); strcat(buf, "<td>Type</td>");
545 strcat(buf, "<td>Protocol</td>");
532 546 strcat(buf, "<td>SType</td>"); strcat(buf, "<td>SType</td>");
533 547 strcat(buf, "<td>State</td>"); strcat(buf, "<td>State</td>");
534 548 strcat(buf, "<td>Addr/port</td>"); strcat(buf, "<td>Addr/port</td>");
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/Conn

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/Conn

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/Conn

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main