JulianSchmid / etherparse

A rust library for parsing ethernet & ethernet using protocols.
Apache License 2.0
286 stars 54 forks source link

IP packets can't be written using the builder pattern #26

Closed karpawich closed 2 years ago

karpawich commented 2 years ago

Right now, packets cannot be written out unless they are fully-assembled transport-layer TCP/UDP packets. In other words, the write function is only implemented for PacketBuilderStep<UdpHeader> and PacketBuilderStep<TcpHeader>:

However, there might be use cases for etherparse where a programmer may want to write an IP packet with a custom transport protocol or handle the protocol assembly and writing themselves. I suggest implementing write for PacketBuilderStep<IpHeader> to support this use case!