Git Product home page Git Product logo

Comments (6)

instantepiphany avatar instantepiphany commented on June 9, 2024

Hi cluelesskenny, I am glad someone has some need for it!
I haven't used arch for a few months - but it looks like when your dynamic linker (ld) tries to find a library for the libconfig functions I use in steamdlfilter, it can only find the 64 bit version.
Could you make sure you have specifically the 32-bit version of libconfig and libconfig-dev installed? If that doesn't let it compile, then the output of sudo pacman -Q | grep libconfig will help me troubleshoot it. (Unless I am remembering pacman syntax incorrectly.)
The out put of ls /usr/ and ls /usr/lib/ might help too :)

from steamdlfilter.

instantepiphany avatar instantepiphany commented on June 9, 2024

Hey cluelesskenny, let me know whether or not my reply helped if you tried again - and if it still isn't resolved I will reopen this issue :)

from steamdlfilter.

cluelesskenny avatar cluelesskenny commented on June 9, 2024

Hi Jordan, sorry to leave you hanging, it's been a busy week. I got some
time to work on this a few days ago and got it going. I double checked the
version of libconfig and, indeed, it was 64-bit. It took me a while to get
the 32-bit version to install. What finally worked was to download the
package as a tarball and install it with 'pacman -U'. Once that was done I
ran your compile code and a few seconds later, there was the library. Nice.
Haven't had a chance to download a game to ensure it is unmetered, but
maybe I can get to that this weekend. I've added my ISP's unmetered mirror
to the config file. I ran the shell script and it launched Steam straight
away. Should be good to go.Thanks again for your help and for making
steamdlfilter :).

Cheers

On 26 March 2015 at 21:58, Jordan Cran [email protected] wrote:

Hey cluelesskenny, let me know whether or not my reply helped if you tried
again - and if it still isn't resolved I will reopen this issue :)


Reply to this email directly or view it on GitHub
#2 (comment)
.

from steamdlfilter.

instantepiphany avatar instantepiphany commented on June 9, 2024

No problem, glad you got it sorted! Yes, while I originally developed steamdlfilter on arch linux I haven't used it for a while, didn't realise there wasn't a working 32-bit package in any of the default mirrors.
Let me know how downloading the game impacts your metered/unmetered usage :)

from steamdlfilter.

cluelesskenny avatar cluelesskenny commented on June 9, 2024

Oh, the 32-bit package was there. It just wouldn’t install in the normal
way because it saw that I already had the 64-bit package installed. Once I
figured that out, then it was just a matter of getting it to install in a
different way.

Unfortunately, the bad news is that the filter doesn’t seem to be working.
I downloaded a 2GB file this morning and only 600MBs was unmetered. If you
have a moment to peruse my config file perhaps that’s where my error lies.
On line 41 I inserted iiNet's unmetered server and on line 45 a log
location. That's the only change.

steamdlfilter.c

#include <sys/socket.h>
#include <sys/types.h>
#include <libconfig.h>
#include <string.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <stdio.h>

ssize_t send(int sockfd, const void *buf, size_t len, int flags) {

const char * cbuf = (const char *) buf;

ssize_t (original_send) (int, const void, size_t, int) =
dlsym(RTLD_NEXT, "send");

config_t config;
config_init(&config);
const char * chome = getenv("HOME");
char prelog[100];
char precfg[100];
char * log = strcpy(prelog, chome);
char * cfg = strcpy(precfg, chome);
const char * configpath = strcat(cfg,"/.config/steamdlfilter/config");
const char * logpath = strcat(log, "/.steamdlfilter.log");

config_read_file(&config, configpath);

int filterenabled;
const char * enablepath = "filterenabled";

config_lookup_bool(&config, enablepath, &filterenabled);

if (strstr(cbuf, "/depot/") && filterenabled == 1) {

  FILE *logfp;
  char *logmode = "a+";

  const char * unmeteredserver;
  const char * serverpath = "[steam.cdn.on.net](http://steam.cdn.on.net)";

  config_lookup_string(&config, serverpath, &unmeteredserver);

  int logging;
  const char * logconfigpath = "/var/games/";

  config_lookup_bool(&config, logconfigpath, &logging);

  if (strstr(cbuf, unmeteredserver)) {
      if (logging == 1) {
          logfp = fopen(logpath, logmode);
                  fprintf(logfp, "=======ALLOWED=======\n%s\n", cbuf);
                  fclose(logfp);
      }
              return original_send(sockfd, buf, len, flags);
}
  else {
              if (logging == 1) {
        logfp = fopen(logpath, logmode);
        fprintf(logfp, "=======BLOCKED=======\n%s\n", cbuf);
        fclose(logfp);
      }
              return -1;
}

}
else
return original_send(sockfd, buf, len, flags);
config_destroy(&config);

i

I start Steam by opening a terminal and enter sh steamdlfilter.sh. A window
pops up telling me Steam is being updated and then the login window
appears. I enter my password and Steam launches. All good. Meanwhile, the
terminal window fills up with all sorts of messages about what's going on
in the background. Will there be any message in there to say that
steamdlfilter is doing it's thing? Are there any error messages I should
look for? The log file specified in the config is empty. I'm feeling a
little lost.

Any guidance would be greatly appreciated.

Reply to this email directly or view it on GitHub
#2 (comment)
.

from steamdlfilter.

instantepiphany avatar instantepiphany commented on June 9, 2024

Hi cluelesskenny, I can see a few potential problems there, namely the modifications to steamdlfilter.c.
This file shouldn't need to be modified, I have made the steamdlfilter library read the unmetered server information from the config file. In the instructions contained in the README, the first step says:

"Copy config to $HOME/.config/steamdlfilter/ and modify the unmetered server value and the logging value to your liking"

Unfortunately I forgot to include the default config file, I have a link below.

The "config" file is included here with the bigpond server set as the unmetered server. Simply copy this file to /home/clueslesskenny/.config/steamdlfilter/ (there should already be a folder named .config in your home folder, create a folder called steamdlfilter and place the config file in that folder). Then just change the bigpond link in that file to the iiNet link, and then try steamdlfilter again :)

Don't forget to change the steamdlfilter.c file back to how it was originally, the easiest way would probably be to just download it again. When I have time, I will flesh out the config utility that so far just disables/enables the filter so that you only need to install the library, and then use the gui config utility to set it to your server. That is in the future though :)

In regards to the logging, a log is created at $HOME/.steamdlfilter.log, a good way to view this as it changes would probably be running tail -fn 100 ~/.steamdlfilter.log in a separate terminal window. This will show you the end of the file always, so you will see essentially a live status of steamdlfilter blocking and allowing each download.

from steamdlfilter.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.