Deleted Added
full compact
unimsg.c (121330) unimsg.c (131823)
1/*
2 * Copyright (c) 1996-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
1/*
2 * Copyright (c) 1996-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * $Begemot: libunimsg/libunimsg/unimsg.c,v 1.3 2003/09/19 13:10:35 hbb Exp $
29 * $Begemot: libunimsg/libngatm/unimsg.c,v 1.4 2004/07/08 08:21:41 brandt Exp $
30 *
31 * User space message structure.
32 */
33
34#include <stdio.h>
35#include <stdlib.h>
36#include <stdarg.h>
37#include <string.h>

--- 120 unchanged lines hidden (view full) ---

158
159/*
160 * Strip the last 32 bit word from the buffer.
161 * Barf if there is no word left.
162 */
163u_int
164uni_msg_strip32(struct uni_msg *msg)
165{
30 *
31 * User space message structure.
32 */
33
34#include <stdio.h>
35#include <stdlib.h>
36#include <stdarg.h>
37#include <string.h>

--- 120 unchanged lines hidden (view full) ---

158
159/*
160 * Strip the last 32 bit word from the buffer.
161 * Barf if there is no word left.
162 */
163u_int
164uni_msg_strip32(struct uni_msg *msg)
165{
166 u_int32_t w;
166 uint32_t w;
167
168 msg->b_wptr -= 4;
169 bcopy(msg->b_wptr, &w, 4);
170 return (ntohl(w));
171}
172
173/*
174 * Strip the first four bytes of the buffer.
175 */
176u_int
177uni_msg_get32(struct uni_msg *msg)
178{
167
168 msg->b_wptr -= 4;
169 bcopy(msg->b_wptr, &w, 4);
170 return (ntohl(w));
171}
172
173/*
174 * Strip the first four bytes of the buffer.
175 */
176u_int
177uni_msg_get32(struct uni_msg *msg)
178{
179 u_int32_t w;
179 uint32_t w;
180
181 bcopy(msg->b_rptr, &w, 4);
182 msg->b_rptr += 4;
183 return (ntohl(w));
184}
185
186/*
187 * Append a 32 bit word to the buffer.

--- 58 unchanged lines hidden ---
180
181 bcopy(msg->b_rptr, &w, 4);
182 msg->b_rptr += 4;
183 return (ntohl(w));
184}
185
186/*
187 * Append a 32 bit word to the buffer.

--- 58 unchanged lines hidden ---