ucmd_host.c 360 B

123456789101112131415161718
  1. /* host: ring-3 command. One DNS A query; the resolver prints its answers. */
  2. #include "ucmd_lib.h"
  3. void _start(const char *arg)
  4. {
  5. unsigned char ip[4];
  6. if (!arg || !arg[0]) {
  7. u_puts("host: usage host <name>\n");
  8. u_exit(1);
  9. }
  10. u_syscall0(SYS_NET_ACQUIRE);
  11. u_syscall2(SYS_DNS_RESOLVE, (int)arg, (int)ip);
  12. u_syscall0(SYS_NET_RELEASE);
  13. u_exit(0);
  14. }