]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add is_local_IP() function to help distinguish which bandwidth "matters"
authorRoger Dingledine <arma@torproject.org>
Tue, 13 Jul 2004 16:57:37 +0000 (16:57 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 13 Jul 2004 16:57:37 +0000 (16:57 +0000)
svn:r2040

src/common/util.c
src/common/util.h

index 21ede0580e27bd56e3ddaaaf57be81ec925d4534..7b22bb973ab1728737fcd0d80ee96fb7b561ac03 100644 (file)
@@ -1468,6 +1468,14 @@ int is_internal_IP(uint32_t ip) {
   return 0;
 }
 
+/** Return true iff <b>ip</b> (in host order) is judged to be on the
+ * same network as us. For now, check if it's an internal IP. For XXX008,
+ * also check if it's on the same class C network as our public IP.
+ */
+int is_local_IP(uint32_t ip) {
+  return is_internal_IP(ip);
+}
+
 /* Hold the result of our call to <b>uname</b>. */
 static char uname_result[256];
 /* True iff uname_result is set. */
index 4b44d1a44c7f78dc8fc06412e06f4805339a9893..cfcfaafecea945944897b1aa0b8d3564be7ee5a7 100644 (file)
@@ -232,6 +232,7 @@ void tor_mutex_free(tor_mutex_t *m);
 int tor_socketpair(int family, int type, int protocol, int fd[2]);
 
 int is_internal_IP(uint32_t ip);
+int is_local_IP(uint32_t ip);
 
 const char *get_uname(void);