summaryrefslogtreecommitdiff
path: root/util/subs.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-29 15:44:44 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-29 15:44:44 +0200
commitb18f5bf2db0fba2e7e539f68645836036d940d26 (patch)
tree23c4dd8f3d273f34ef9bbe1799d1958685559915 /util/subs.c
parenta7f89980e5b3f4b9a74c70dbc5ffe8aabd28be28 (diff)
Imported Upstream version 2.9.6upstream/2.9.6
Diffstat (limited to 'util/subs.c')
-rw-r--r--util/subs.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/util/subs.c b/util/subs.c
index 9f11423..c5f9308 100644
--- a/util/subs.c
+++ b/util/subs.c
@@ -163,6 +163,23 @@ void lperror(int level, const char * format, ...)
return;
}
+#ifdef LANHELPER
+uint32_t buf2long(uint8_t * buf);
+uint16_t buf2short(uint8_t * buf);
+void printbuf(const uint8_t * buf, int len, const char * desc);
+const char * buf2str(uint8_t * buf, int len);
+const char * oemval2str(uint16_t oem, uint16_t val, const struct oemvalstr *vs);
+const char * val2str(uint16_t val, const struct valstr *vs);
+uint16_t str2val(const char *str, const struct valstr *vs);
+#else
+ulong buf2long(uchar * buf)
+{
+ return (ulong)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
+}
+ushort buf2short(uchar * buf)
+{
+ return (ushort)(buf[1] << 8 | buf[0]);
+}
void printbuf(const uchar * buf, int len, const char * desc)
{
int i;
@@ -190,14 +207,6 @@ const char * buf2str(uchar * buf, int len)
str[len*2] = '\0';
return (const char *)str;
}
-ushort buf2short(uchar * buf)
-{
- return (ushort)(buf[1] << 8 | buf[0]);
-}
-ulong buf2long(uchar * buf)
-{
- return (ulong)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
-}
#define IPMI_OEM_PICMG 12634
#define SZUN 32
@@ -237,6 +246,7 @@ ushort str2val( char *str, struct valstr *vs)
}
return vs[i].val;
}
+#endif
void dump_buf(char *tag, uchar *pbuf, int sz, char fshowascii)