Lines Matching +full:ascii +full:. +full:d
3 # This is an example that shows how to send ASCII formatted control
4 # messages to a node using ngctl(8).
6 # What we will do here create a divert(4) tap. This simply dumps
7 # out all packets diverted by some ipfw(8) divert rule to the console.
39 # anything. The ``inet/raw/divert'' is the hook name on the ksocket
40 # node, which tells it what kind of socket to create.
42 # Lets give our ksocket node a global name. How about ``fred'':
46 # Note that we used ngctl's ``name'' command to do this. However,
52 # Here we are using the ASCII <-> binary control message conversion
53 # routines. ngctl does this for us automatically when we use the
54 # ``msg'' command.
57 # supplied by the system. We do this by sending the ksocket node a
58 # ``bind'' control message. Again, ngctl does the conversion of the
59 # control message from ASCII to binary behind the scenes.
61 + msg fred: bind inet/192.168.1.1
64 # special support for the PF_LOCAL and PF_INET protocol families.
66 # ``bind'' command as ``inet/192.168.1.1'' (since we didn't specify
67 # a port number, it's assumed to be zero). We could have also
74 # new ones is added.
78 # types when parsing. Now since we didn't ask for a specific port
82 Rec'd response "getname" (5) from "fred:":
83 Args: inet/192.168.1.1:1029
85 # As soon as we sent the message, we got back a response. Here
89 # as ``fred:''. The message arguments field is then displayed to
90 # us in its ASCII form. In this case, what we get back is a struct
91 # sockaddr, and there we see that our port number is 1029.
94 # want to see. How about anything from 192.168.1.129.
98 $ ipfw add 100 divert 1029 ip from 192.168.1.129 to any
99 00100 divert 1029 ip from 192.168.1.129 to any
105 Rec'd data packet on hook "foo":
106 0000: 45 00 00 3c 57 00 00 00 20 01 bf ee c0 a8 01 81 E..<W... .......
107 0010: c0 a8 01 01 08 00 49 5c 03 00 01 00 61 62 63 64 ......I\....abcd
108 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
111 Rec'd data packet on hook "foo":
112 0000: 45 00 00 3c 58 00 00 00 20 01 be ee c0 a8 01 81 E..<X... .......
113 0010: c0 a8 01 01 08 00 48 5c 03 00 02 00 61 62 63 64 ......H\....abcd
114 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
117 Rec'd data packet on hook "foo":
118 0000: 45 00 00 3c 59 00 00 00 20 01 bd ee c0 a8 01 81 E..<Y... .......
119 0010: c0 a8 01 01 08 00 47 5c 03 00 03 00 61 62 63 64 ......G\....abcd
120 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
125 # hook of ngctl's socket node. Since the packets are getting diverted,
126 # the 192.168.1.129 machine doesn't see any response from us.
131 + msg bar connect inet/192.168.1.33:13
134 Rec'd data packet on hook "foo":
135 0000: 4d 6f 6e 20 4e 6f 76 20 32 39 20 31 37 3a 34 38 Mon Nov 29 17:48
136 0010: 3a 33 37 20 31 39 39 39 0d 0a :37 1999..
142 + msg bar bind local/"/tmp/bar.socket"
145 # Here's an example of a more complicated ASCII control message argument.
146 # If you look in /sys/netgraph/ng_message.h, you will see that a node
163 # this structure in ASCII form (lines wrapped for readability):
165 + msg bar bind local/"/tmp/bar.socket"
167 Rec'd response "listhooks" (7) from "bar":