+port_spec : PORT STRING ';' {
+#ifndef NONETWORK
+ struct servent *s = getservbyname($2, "udp");
+ if (!s) {
+ moan("unknown service `%s' at line %i",
+ $2, lex_line);
+ yynerrs++; YYERROR;
+ }
+ daemon_usePort(s->s_port);
+#else
+ yyerror("`port' command unsupported");
+ yynerrs++; YYERROR;
+#endif
+ }
+ | PORT INT ';' {
+#ifndef NONETWORK
+ daemon_usePort(htons($2));
+#else
+ yyerror("`port' command unsupported");
+ yynerrs++; YYERROR;
+#endif
+ }