patch-src_supl-client_c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - implement bind to device functionality
  2. --- trunk.orig/src/supl-client.c 2011-10-21 20:51:38.000000000 +0200
  3. +++ trunk/src/supl-client.c 2013-04-24 18:55:01.937252375 +0200
  4. @@ -252,6 +252,7 @@ static char *usage_str =
  5. " --cell gsm:mcc,mns:lac,ci|wcdma:mcc,msn,uc set current gsm/wcdma cell id\n"
  6. " --cell gsm:mcc,mns:lac,ci:lat,lon,uncert set known gsm cell id with position\n"
  7. " --format|-f human machine parseable output\n"
  8. +" --interface|-i iface bind to this interface\n"
  9. " --debug|-d <n> 1 == RRLP, 2 == SUPL, 4 == DEBUG\n"
  10. " --debug-file file write debug to file\n"
  11. " --help|-h show this help\n"
  12. @@ -267,6 +268,7 @@ static struct option long_opts[] = {
  13. { "cell", 1, 0, 0 },
  14. { "debug", 1, 0, 'd' },
  15. { "format", 1, 0, 'f' },
  16. + { "interface", 1, 0, 0},
  17. { "test", 1, 0, 't' },
  18. { "set-pos", 1, 0, 0 },
  19. { "pos-helper", 1, 0, 0 },
  20. @@ -310,7 +312,7 @@ int main(int argc, char *argv[]) {
  21. int opt_index;
  22. int c;
  23. - c = getopt_long(argc, argv, "ad:f:t:", long_opts, &opt_index);
  24. + c = getopt_long(argc, argv, "ad:f:i:t:", long_opts, &opt_index);
  25. if (c == -1) break;
  26. switch (c) {
  27. case 0:
  28. @@ -374,6 +376,11 @@ int main(int argc, char *argv[]) {
  29. }
  30. break;
  31. + case 'i':
  32. + strncpy(ctx.iface, optarg, IFNAMSIZ);
  33. + ctx.iface[IFNAMSIZ] = 0;
  34. + break;
  35. +
  36. case 'd':
  37. {
  38. int debug = atoi(optarg);