summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2011-06-07 11:05:14 -0700
committerQuIC Gerrit Code Review <code-review@localhost>2011-06-07 11:05:14 -0700
commite666d69d604d727dda461a1b810063bf655f1fe4 (patch)
tree8bb96ea27bb26eaa3330d947a32cecc569cfab62
parent628a9221c0d10574d55dd02ea19f284139b706d8 (diff)
parentadc1e694ff00cd96141db96a5b054913c668d6a1 (diff)
downloadbionic-e666d69d604d727dda461a1b810063bf655f1fe4.zip
bionic-e666d69d604d727dda461a1b810063bf655f1fe4.tar.gz
bionic-e666d69d604d727dda461a1b810063bf655f1fe4.tar.bz2
Merge "LibC definitions for missing elements needed for networking" into gingerbreadM8960AAAAANLYA100406M8960AAAAANLYA1004M8960AAAAANLYA100310M76XXUSNEKNLYA1060M76XXUSNEKNLYA1050M76XXUSNEKNLYA1040
-rw-r--r--libc/bionic/stubs.c37
-rw-r--r--libc/kernel/common/linux/pkt_sched.h1
2 files changed, 35 insertions, 3 deletions
diff --git a/libc/bionic/stubs.c b/libc/bionic/stubs.c
index d495674..e943e9e 100644
--- a/libc/bionic/stubs.c
+++ b/libc/bionic/stubs.c
@@ -341,7 +341,7 @@ getgrnam(const char *name)
struct netent* getnetbyname(const char *name)
{
- fprintf(stderr, "FIX ME! implement getgrnam() %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "FIX ME! implement getnetbyname() %s:%d\n", __FILE__, __LINE__);
return NULL;
}
@@ -373,15 +373,46 @@ struct netent *getnetbyaddr(uint32_t net, int type)
return NULL;
}
+// Android doesn't have /etc/protocols. Use this minimal list.
+struct protoent protocols[] = {
+ {"ip", {"IP", NULL}, 0},
+ {"icmp", {"ICMP", NULL}, 1},
+ {"tcp", {"TCP", NULL}, 6},
+ {"udp", {"UDP", NULL}, 17},
+ {NULL, {NULL}, 0}
+};
+
struct protoent *getprotobyname(const char *name)
{
- fprintf(stderr, "FIX ME! implement %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
+ int i = 0;
+
+ while (name && protocols[i].p_name != 0)
+ {
+ if (strcmp(protocols[i].p_name, name) == 0)
+ {
+ return &protocols[i];
+ }
+
+ i++;
+ }
+
return NULL;
}
struct protoent *getprotobynumber(int proto)
{
- fprintf(stderr, "FIX ME! implement %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
+ int i = 0;
+
+ while (protocols[i].p_name != 0)
+ {
+ if (protocols[i].p_proto == proto)
+ {
+ return &protocols[i];
+ }
+
+ i++;
+ }
+
return NULL;
}
diff --git a/libc/kernel/common/linux/pkt_sched.h b/libc/kernel/common/linux/pkt_sched.h
index 0b2966a..992a7a3 100644
--- a/libc/kernel/common/linux/pkt_sched.h
+++ b/libc/kernel/common/linux/pkt_sched.h
@@ -95,6 +95,7 @@ struct tc_prio_qopt
{
int bands;
__u8 priomap[TC_PRIO_MAX+1];
+ __u8 enable_flow;
};
struct tc_multiq_qopt {